views:

204

answers:

4

jquery.js source code is not being recognised by browser using my page.html served by Google App Engine as a http:some_request to the SDK, BUT when I load the exact same page.html into the browser directly from my local hard drive as jquery.js all works OK, it is recognized, so I know my path is OK....

In the header of my page.html I have the following:

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

From my app.yaml:

- url: /static
  static_dir: static
  expiration: 1d
A: 

For the second try this one

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

Double check your paths, and also check the weather of external scripts are they available.

vaske
I didnt understand this part of what you wrote "...check the weather of external scripts are they available." .. could you please explain what you mean?I tried your suggest of ./static with but didnt work.BTW. I have now gotten this to work:<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>But I would still like to recognize /static/jquery.js so I can work when off-lineSo my main question now is how do i check if 'external scripts are available' ?
indiehacker
Yes, I mean to check are the external script available.
vaske
yes I tested it was available since jquery is recognized when I load the html page directly into the browser from my hard drive --- it just doest work, using the same URLs when using the from app engine...
indiehacker
+1  A: 

Did you upload jquery.js with you app and set up a static file handler for it?

hwiechers
I am just wanting it to work off-line from th SDK for now
indiehacker
In my app.yaml I have the following, so I think I am OK with setting up a static file handler:- url: /static static_dir: static expiration: 1d
indiehacker
You are right. All in needed to do was put the jquery.js in the correct static folder of the app. Sorry for the silly question.
indiehacker
A: 

or you can try referencing the jQuery file as

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
Bunny Rabbit
what you write work - thanks - but I would still like to see it work from the /static directory so I can work with the SDK off-line
indiehacker
A: 

The key is that all files you want to be recognized by the client's browser such jquery.js should be inside a directory that is inside the static directory.

So the portion of the app.yaml file that relates to this should appear as follows:

- url: /jquery
  static_dir: static/jquery


- url: /static
  static_dir: static
  expiration: 1d

what is key line that I now changed to make it work is where jquery stuff is inside static directory: static_dir: static/jquery

so now in the header section of the page.html I have this working so I can work with the SDK off-line:

<script type="text/javascript" src="/jquery/jquery.js" ></script>
<script type="text/javascript" src="/jquery/jquery.form.js" ></script>
indiehacker