I am using php, and need to load() this , template content php file into the jquery and pass it to a #div ID to render front-end view.
I am not sure how to load the php file in jquery and then pass it as a variable called repeater which helps build out all the rows combining the template loaded with Ajax (obj) query results.
In the set alert, it pops up as [object Object], no template.
When I write the entire php template content out into jquery as var repeater, it works, but I do not want all that html in jquery. Just load() then read.
Here is the code if this makes any sense
Code:$('#pageContent').load('../includes/OrderLookup.php #pageContent'); alert ($('#pageContent').load('OrderLookup.html #pageContent')); var url = $('#pageContent').load('../includes/OrderLookup.php'); var page = '<div id="pageContent"></div>'; var repeater = $('#pageContent').load('OrderLookup.html #pageContent'); var pageBuildUp=''; for (x in dataArray){ pageBuildUp += obj.repeater; //alert(obj.repeater); //pageBuildUp += url; pageBuildUp = pageBuildUp.replace('##transactionId##',makeTextSmall(dataArray[x]['blockvalue'],20)); if (dataArray[x]['description']==''){ pageBuildUp = pageBuildUp.replace('##orderTotal##','no total amount'); }


Reply With Quote
Bookmarks