Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

how to display javascript in amp

function showHint()

{

 

//alert("This is the first.");

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 && xmlhttp.status==200)

{

document.getElementById("txtHint").innerHTML=xmlhttp.responseText;

}

}

var theSecondDate=new Date();

var d=theSecondDate.getUTCDate();

var a=theSecondDate.getUTCMonth()+1;

var y=theSecondDate.getFullYear();

 

xmlhttp.open("GET","dailyhoroscopetoday.php?sign=Aries&hday="+d+"&hmonth="+a+"&hyear="+y,true);

xmlhttp.send();

}

1 Reply
Copilot Lvl 2
Message 2 of 2

Re: how to display javascript in amp

Please help me to convert the javascript function into Accelerated mobile page(Amp) javascript,

I am new learner to Amp language.