didgydont Posted October 19, 2008 Share Posted October 19, 2008 hi i am building a iframe home page for online links basicly what i want is to make it so when the i frame changes it tells the data base so i can make a add this page button i have tried this in php <iframe name='theframe' width='100%' height='100%' src='http://www.google.com' onload=\"UpdURL(this.value)\"></iframe> and made a js file with this function UpdURL(str) { var url="doedit.php" url=url+"?lasturl="+str url=url+"&sid="+Math.random() } it doesnt seem to be going to the doedit.php in background and i did alert for str and it said undefiened any ideas ? Quote Link to comment Share on other sites More sharing options...
F1Fan Posted October 20, 2008 Share Posted October 20, 2008 You don't have your AJAX object and you're not doing anything with car "url." Is this all of your code? Quote Link to comment Share on other sites More sharing options...
didgydont Posted October 22, 2008 Author Share Posted October 22, 2008 no i got it updating but cant get iframe url does not look possible var xmlHttp function UpdURL(str) { if (str.length==0) { document.getElementById("txtHint").innerHTML="" return } xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="doedit.php" url=url+"?lasturl="+str url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } function stateChanged() { if (xmlHttp.readyState==3 || xmlHttp.readyState=="complete") { } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.