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

  • SEARCH
  • Home
  • 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 8273691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:33:01+00:00 2026-06-08T07:33:01+00:00

I have a Java EE project that uses lots of html, javascript, java etc.

  • 0

I have a Java EE project that uses lots of html, javascript, java etc. I’m looking to use JQuery to load up an html template into a div tag however I’m unsure of where the relative path of the load method starts from.

The html file I’m trying to load is within the project but in a different directory. Would I have to back down and go back up to get to the path? And if there is an easy way to find out by some type of debugging methods of what the correct path is …. that would be BONUS! The javascript (JQuery) that its using is loaded in, the line below is also in another file. I have something like the following

$("<div id=\"eventMaintDialog\"></div>").appendTo($("body"));
$("eventMaintDialog").load("src\main\webapp\resources\js\template\Event\EventMaintTemplate.html");

I hope I explained this clearly. I feel like I keep changing the path but get nothing. I’m taking stabs in the dark. Thanks in advance.

  • 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-08T07:33:03+00:00Added an answer on June 8, 2026 at 7:33 am

    Javascript runs in the browser, it has no knowledge of your Java EE project.

    You can open up your browsers console and write this on the page to see:

    var resolved = $("<a>", {href: "src\main\webapp\resources\js\template\Event\EventMaintTemplate.html"}).prop( "href" );
    
    resolved; //The absolute url 
    //"http://stackoverflow.com/questions/11604170/srcmainwebappesourcesjsemplateEventEventMaintTemplate.html"
    

    It depends on the page’s url you are running the code on.

    Note that "\" is escape character in javascript strings. You probably wanted "/" there.

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

Sidebar

Related Questions

I have a java project that uses JPA 2/Hibernate 3.5.6 for data access and
i have a java ee project which has a text file that uses a
I have a project in Java I am running that uses an external JAR
I have a Java project that uses this driver for serial communication. The driver
I have a java/maven project that uses tango icons, so I'm using the following
I have an existing Java project in Netbeans that uses Swing and I would
I have a project that uses Java and Groovy intermixed. This works very well.
I have a project that uses a Java library converted using IKVM . I
I have a java project that uses java.io.RandomAccessFile to manage data loading. It seeks
I have a Rails 3 project that uses some java jar files. I'm putting

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.