- Where Developers Learn, Share, & Build Careers


I know that a .jax () is a jQuery plugin Calling is not possible, the only way is to write a function in the parent page and this function is called a part of the AJAX request in the function (data) . It works normally, but I'm stuck because my function needs a variable to work properly with loaded content and whichever I am trying to load, the original from the loaded content See my example:

This is my job:

  function doPaginate (maxpage) {jQuery ("# ​​demo5") . Paginate ({count: maxpage}); }a????   

This is my jQuery.ajax () request:

  function loadProfileTab (tab, owner info) {jQuery. Post ("./profile_ajax.php", {task: 'profiletab', v: tab, user_id: ownerinfo}, function (data) {jQuery ("# ​​profile_content_wrapper") .html (data); doPaginate (maxpage) ;}); }a????   

Now I'm trying to get the variable maxpage from the PHP loaded content to function doPaginate (maxpage) <

I have some actions, for example to get the result of $ maxpage first start a request, then request a request again Use this result in the new results, but it seems that "best" is not a solution.

Can someone lead me to a better solution? Or is it just impossible for me to try in the example above my code?

Best regards!

You have a hidden HTML code given by AJX for the maxpage variable You can add values ​​as fields and use jQuery to search for the value, something like

  var data = '& lt; Html & gt; & Lt; Head & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form & gt; & Lt; Div & gt; Blay & lt; / Div & gt; & Lt; Input id = maximum page "type =" hidden "value =" 10 "/> gt;    'var maxpage = $ (Data). Find ('# maxpage'). Val (); console.log (maxpage); Warning (maxpage);   

Here is this code for one ?? ??

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -