Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8920537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:17:50+00:00 2026-06-15T06:17:50+00:00

I am new in jQuery and I’m trying to develop a client for my

  • 0

I am new in jQuery and I’m trying to develop a client for my web service. I’ve tried something simple, just for testing, but still it doesn’t work, although it seems ok to me.

I have the jQuery library in my tomee/webapp folder, along with my html and javascript files. If I write some non-jQuery code in my javascript file, it works.

I have the following code:

index.html

<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript" src="client.js"></script>
    </head>
    <body>
        <input type="button" id="getAllButton" value="Get all books" onclick="return getAllBooks()"/>
        <div id="messageBox"></div>
    </body>
</html>

client.js

function getAllBooks() {
    $.ajax({
        dataType: 'application/xml',
        type: 'GET',
        url: rootURL + '/books',
        success: function (data) {
            alert(1);
        },
        error: function (data) {
            alert(2);
        }
    });
}

The problem is that no alert will appear. If a write pure javascript (I mean without jQuery), alerts will do appear.

Why do alerts not appear? Any advice?

Thank you!

Sorin

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:17:51+00:00Added an answer on June 15, 2026 at 6:17 am

    Thanks charlietfl for your tips! They helped me solve the problem.

    The problem was that it didn’t know who rootURL is. I found rootURL in an example and I thought that is something defined in jQuery. It seems it isn’t.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to use the new jquery-ui, and all but the resizable function
Fairly new to jquery so I might be making a simple mistake but I
I new with jquery and I can do simple coding with it. and I
Very new to JQuery and MVC and webdevelopment over all. I'm now trying to
Im new in jQuery so sure that i am doing something wrong :(. Matter
I'm trying to write a new jQuery plugin. base (this is not my plugin,
New to jQuery here. I've found several web pages that come close to what
I am a new jquery/js user trying to pass an argument from a selector
I'm trying to implement the new jQuery Mobile Alpha 2. Currently, any link within
I'm trying to create a jQuery like architecture in my app but i could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.