Jump to content
View in the app

A better way to browse. Learn more.

Дизайн и модификация Invision Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Выполнить jaix запрос

Подкиньте пожалуйста пример запроса. Что та не разберу...

 

 

К примеру есть такой запрос

'?app=core&module=system&controller=ajax&do=instantNotifications&csrfKey=4895a3112df989ba11f9a483540fefb1&notifications=0&messages=0'

 

К какому скрипту он обращается, можно путь полностью? :rolleyes:

Featured Replies

  • Author

Верный код?

window.onload = function(){
   new Ajax.Request('app=core&module=system&controller=ajax&do=instantNotifications',{
hideLoader: true,
onSuccess: function(t){



   }});
};

Edited by Testweb

  • Author

Мужики, подскажите

:mellow:

Кого? Чего?

'?app=core&module=system&controller=ajax&do=instantNotifications&csrfKey=4895a3112df989ba11f9a483540fefb1&notifications=0&messages=0'

applications/core/modules/front/system/ajax.php

  • Author

Дописал

	public function doExecute()
{




    \IPS\Output::i()->json('sds');	

}

 

 

window.onload = function(){
  new Ajax.Request('?app=core&module=system&controller=ajax&do=instantNotifications',{
      hideLoader: true,
      onSuccess: function(t){	
	alert('ff');
      }
  });
};

 

Алерт не получаю, должно все работать.

  • Author

От скрипта должен получить ответ "sds", в js должно сработать алерт. В чем допустил ошибку?

Дописал

    public function doExecute()

    {

        \IPS\Output::i()->json('sds');  

    }

И где Вы нашли метод doExecute?

У Вас в коде вообще запрос идет к instantNotifications

  • Author

Как верно составить js код чтобы он работал, сейчас ошибка при запросе.

 

Как составить код использую готовые методы, как в ips делают jaix запросы.

как в ips делают jaix запросы.

ips.getAjax()(url)
.done(function(){

}).fail(function(){

});

сейчас ошибка при запросе.

Не вижу ошибок

Как верно составить js код чтобы он работал, сейчас ошибка при запросе.

В /applications/core/modules/front/system/ajax.php:

	public function myFunction()
{
	\IPS\Output::i()->json( array( 'content' => 'My content...' ) );
}

В JS:

	ips.getAjax()( ips.getSetting('baseURL') + 'index.php?app=core&module=system&controller=ajax&do=myFunction', {
	dataType: 'json',
	showLoading: true,
	timeout:  10000
})
.done( function(response) {
	alert(response.content);
})	
.fail( function() {
	alert('Error!');
});

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.