Jump to content
php.lv forumi

AJAX request pārbaude


ArnisR

Recommended Posts

Kā ar jQuery pārbaudīt, vai notiek Ajax pieprasījums? Piemēram, nospiežot pogu, darbībām jāizpildās tikai tad, kad pabeigts Ajax request's:

 

$("button").click(function(){

if(darbojas Ajax)
{
return false;
}
else
{
Izpildīt dažādas darbības...
}

});

Link to comment
Share on other sites

Tā kā šī ir PHP sadaļa, tad, izlasot tikai virsrakstu, pareizā atbilde ir...

 

if (
 isSet( $_SERVER['HTTP_X_REQUESTED_WITH'] )
 && strToLower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) === 'xmlhttprequest'
)

 

P.S. Pārvietoju.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...