tags:

views:

88

answers:

4

I've got a simple HTML page

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head>
<title>Home </title>

<script type="text/javascript" src="_includes/jquery.js"></script>
<script type="text/javascript" src="_includes/readAboutXML_OLD.js"></script>

</head>
<body>

<div id="content"></div>

<script>
$(document).ready(function(){ loadXML("page1"); }); 
</script>

</body>
</html>

and my readAboutXML_OLD.js file

function loadXML(whichPage) {

    $.get("_includes/about.xml",{ },function(xml){
     $("#content").append($(whichPage,xml).find("content").html());
    });
}

the jquery.js is version 1.3.2 and all works fine on my local machine. but when I upload it to a server, FF error console says "Error:this[0].innerHTML is undefined" (then points to my sourcefile).

Can anyone enlighten me?? again, the file works find locally, XML gets displayed and all is good. oh, here's the XML:

<?xml version="1.0" encoding="UTF-8" ?>
<about>

  <page1>
     <imageTag>about/ProgramOverview.jpg</imageTag>
     <headline>Program Overview</headline>
     <content>
<p><strong>Unparalleled Learning and Networking Opportunities</strong></p>
     <p>Financial support is a critical component of the Program............</p></content>
     <captionText>Scholar</captionText>
     <captionBkgd>about/ProgramOverviewCaptionBkgd.jpg</captionBkgd>
  </page1> 
</about>
A: 

super obvious question, but is jquery.js actually in the folder _includes/ on your server?

Sarah Jean
A: 
  • Are you transporting it from a non-case sensitive OS to a case sensitive OS (like Windows to UNIX).. If so check the name on your file exactly matches.
  • Is the security correct on your Includes directory to allow reads by the web server service?

Just stuff to check

Evildonald
A: 

yes, jquery.js is in the proper _includes/ folder. as a matter of fact, I added a test

alert("I'm working")

on line 2 of my readAboutXML_OLD.js file. and it works! however, if I add an "alert" inside the $.get function as in

$.get("_includes/about.xml",{       },function(xml){
     alert("I'm working");
}

it does NOT pop up!

pirco
A: 

actually, I the "alert" DOES pop up, even when I add it inside the $.get function... so now I'm stumped. filenames match in case and security is correct.

UPDATE AGAIN: OK. last troubleshooting shows that when I change the append to

$(#content).append("test");

it works. so somehow, that ...append($(whichPage,xml).find("content").html() bit doesn't work!

any ideas?

pirco