I would like to load html content into a div based on a specific event
and created a function to do that:

function loadContent() {
   $("#myDiv").load("/somepage.html");
}

Problem is, the loading only works if I put loadContent() into an <a>
tag, such as

<a href="#" onclick="loadContent()">click</a>

But I really need this to work based on a parameter that gets figured
out during page load (the content is a browser incompatible message).
I can throw an alert into the loadContent function and it will pop up
during page load, but the content does not load, so I'm doing
something wrong within jQuery.

Can anyone give me a hint what I could be overlooking? I'm still quite
new to it, so it could be anything at this point.

Thanks in advance,
Caroline

Reply via email to