PDA

View Full Version : external jquery.js problem



octerman
07 Sep 2010, 10:45 PM
I have been working on a site and have decided to change the design pattern to use the Zend Framework. I have created a new virtual host to do this work on. So I have set up a directory structure, with Zend in the includes directory and I'm using Smarty as a template engine, which is in there also.

Now in this new virtual host when I go to the domain on my machine example.blar/ the page loads fine and the css files too, but something is going very wrong with the external JavaScript files. When viewing the page source in the browser I can click on the script src attribute and the JavaScript file is shown (jQuery).
But if I put an embedded script into the document and try to use anything from jQuery, eg, $(document).ready(), I get a blank page with no errors or anything.

I have tried


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<html>
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />

<title>example.blar</title>
<base href="http://example.blar" />

<script type="text/javascript" src="/libs/jquery.js"></script>
<link href="/css/example.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
// to see if jQuery has loaded
$(document).ready( function() {
alert("ready");
});
</script>
</head>

if i take out the little test script it loads fine and I can even look at what has loaded using firebug.

This has been driving me mental, can anyone help??