jquery - Getting JS-variable from AJAX loaded content? -
I know that a This is my job: This is my Now I'm trying to get the variable I have some actions, for example to get the result of 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 Here is the code for one ?? ?? .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:
function doPaginate (maxpage) {jQuery ("# demo5") . Paginate ({count: maxpage}); }a????
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????
maxpage from the PHP loaded content to function
doPaginate (maxpage) <
$ 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.
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);
Comments
Post a Comment