Jump to content

Using AJAX to update content


winicius

Recommended Posts

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");

        ...

        ...

}

Link to comment
https://forums.phpfreaks.com/topic/72082-using-ajax-to-update-content/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.