winicius Posted October 6, 2007 Share Posted October 6, 2007 I am having a problem with the following: <a onclick="loadDoc(event)" value="home.xml">Home<\a>. Basically what this is doing is calling the function loadDoc and passing in an event to the javascript function. The problem I am having is that loadDoc is not being executed at all. The reason I know that is because I am calling document.alert(); at the very beginning of the function. So I have come to the conclusion that there might be something wrong with my anchor. I've already checked the spelling of the function, I also made sure that the script is being loaded at the head. Here is a look at a few parts of my document: //this is in my HTML doc <script type="text/javascript" src="xmlloader.js"></script> ... <a onclick="loadDoc(event)" value="home.xml">Home<\a> //this is in the xmlloader.js function loadDoc(evt){ document.alert("hello"); ... ... } Quote Link to comment https://forums.phpfreaks.com/topic/72082-using-ajax-to-update-content/ Share on other sites More sharing options...
winicius Posted October 6, 2007 Author Share Posted October 6, 2007 I meant window.alert('awd'); instead of document.alert(awd'); Quote Link to comment https://forums.phpfreaks.com/topic/72082-using-ajax-to-update-content/#findComment-363580 Share on other sites More sharing options...
bobleny Posted October 6, 2007 Share Posted October 6, 2007 I'm not an expert, but shouldn't this: function loadDoc(evt){ Be this: function loadDoc(event) ---------- Also, I've found that if there is an error in your syntax, NONE of the rest of your JavaScript will work either.... Good luck! Quote Link to comment https://forums.phpfreaks.com/topic/72082-using-ajax-to-update-content/#findComment-363612 Share on other sites More sharing options...
winicius Posted October 7, 2007 Author Share Posted October 7, 2007 Also, I've found that if there is an error in your syntax, NONE of the rest of your JavaScript will work either.... Thanks, that advice put an end to my problem. Quote Link to comment https://forums.phpfreaks.com/topic/72082-using-ajax-to-update-content/#findComment-363850 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.