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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.