Click here to Skip to main content
15,914,452 members

Comments by Member 11176062 (Top 3 by date)

Member 11176062 31-Oct-14 10:39am View    
I am a newbie in javascript. Can you please describe in detail what all steps i need to follow?
Member 11176062 27-Oct-14 0:22am View    
But i am making use of wordpress shortcodes which makes use of many events by themselves which i am unaware of. Isn't there any way where i can just load all the page-loadtime-scripts automatically just after ajax call?
Member 11176062 27-Oct-14 0:21am View    
This is the javascript code i am using to load the sliders returned by above aj.php code one by one. As you can see, i have to manually load two "price_updater_clothings" script everytime i want to update prices on the sliders returned by ajax, otherwise previously defined scripts won't work on it.Kindly help.


<div id="myDiv"></div>
<input type="button" >

<script>
var i=1;
function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4)
{
var scrpt = document.createElement('script');
scrpt.src='http://www.abc.com/price_updater_clothings.js';
document.head.appendChild(scrpt);
var scrpt1 = document.createElement('script');
scrpt1.src='http://www.abc.com/price_updater_clothings_2.js';
document.head.appendChild(scrpt1);
var y1=document.createElement("div");
var y2=xmlhttp.responseText;
y1.innerHTML=y2;
document.getElementById("myDiv").appendChild(y1);
}
}
xmlhttp.open("GET","http://www.abc.com/aj.php?id="+(i++),true);
xmlhttp.send();
}
</script>