Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » jQuery does not work on eclipse localhost (jetty)(jQuery works when testing locally but not via eclipse jetty)
jQuery does not work on eclipse localhost (jetty) [message #1015035] Wed, 27 February 2013 04:20 Go to next message
Melanie Lauber is currently offline Melanie Lauber
Messages: 1
Registered: February 2013
Junior Member
Hi everyone,
I have a Eclipse Java EE, Juno Service Release 1.
I added the Jetty component to test my mobile apps.
But I somehow can't get jQuery mobile to work when testing through jetty (localhost in eclipse - I do not have an appache or likewise): right-click on project->Run As->Web App Preview.

(I included the jQuery mobile JS/CSS files in the head of my index.html:
<link rel="stylesheet" type="text/css" href="lib/jquery.mobile-1.0.1.css">
<script src="lib/jquery-1.6.4.js"></script>
<script src="lib/datajs-1.0.2.js"></script>
<script src="scripts/app.js"></script>
<script src="scripts/connectivity.js"></script>
)

If I run the page through the browser pointing to my file location, the jQuery mobile works (no error):
D:\...\z_workspace_eclipse\CRM_test\WebContent\index.html


But if I run my project in the Web App Prview I get following error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB7.4; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)
Timestamp: Wed, 27 Feb 2013 09:05:47 UTC

Message: '$.mobile' is null or not an object
Line: 119
Char: 25
Code: 0
URI: http:// localhost:63966/CRM_test/index.html



When comparing the URLs I see that when running on localhost the folder WebContent is not in the URL but still, index.html is found.
But it seems as if my jQuery mobile JS/CSS files are never loaded/found.
Why not? Or rather, how to fix this?

A little note:
When I tried to load the JS/CSS files from jQuery directly in the localhost URL:
http:// localhost:63966/CRM_test/lib/jquery.mobile-1.0.1.css

Then I get once only an "Windows Internet Explorer" error saying:
Unable to download jquery.mobile-1.0.1.css from localhost.
Unable to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.


If I press OK and load the exact same file again, I do get the CSS file. So I know something isn't complete right but I have no idea how to fix it. Any ideas?

Best regards,
Melanie
Re: jQuery does not work on eclipse localhost (jetty) [message #1015236 is a reply to message #1015035] Wed, 27 February 2013 15:51 Go to previous message
Russell Bateman is currently offline Russell Bateman
Messages: 3133
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 2/27/2013 12:23 PM, Melanie Lauber wrote:
> Hi everyone,
> I have a Eclipse Java EE, Juno Service Release 1.
> I added the Jetty component to test my mobile apps.
> But I somehow can't get jQuery mobile to work when testing through jetty
> [snip]

Be prepared not to get this answered in this forum. It would be more
appropriate in the Eclipse web tools forum, but even there, it would
only be because someone who just knows happened to answer. Unless I've
misunderstood, I would have to say that this isn't an Eclipse-related
question at all.

I personally would suggest stackoverflow with careful tagging.
Previous Topic:How to add problems to compilation unit
Next Topic:Android can't test on Alcatel one touch 890D
Goto Forum:
  


Current Time: Tue Jul 29 08:51:07 EDT 2014

Powered by FUDForum. Page generated in 0.01923 seconds