Solved

Javascript won't run inside of DIV

Posted on 2009-07-07
6
203 Views
Last Modified: 2012-05-07
I have a form that submits and after it inserts, the data into my database the results results are returned using an include statement.  I have a "Please Wait" loader that is is a DIV and is hidden when the results are returned.  The problem is that when I load this into the final product the javascript does not load any longer  I am housing the pages inside of a DIV so the loader would end up being a nested DIV.  At the end of the day, I need a "Please Wait" loader to display while the user is waiting on the query results so any help is appreciated.
0
Comment
Question by:techguy20170
6 Comments
 
LVL 4

Expert Comment

by:khsater
Comment Utility
Can you include some code that shows what you're trying to do?
0
 
LVL 41

Expert Comment

by:HonorGod
Comment Utility
If you are putting the javascript into the div as part of this process, you are correct.  It will not execute.

What kind of code is being loaded?  A function, a statement?

You might be able to eval() the statement.
0
 

Author Comment

by:techguy20170
Comment Utility
I have a form that is nested in a div and uses AJAX to submit.  When the form is submitted, my returned page is a page that inserts the form data into my database.  The page also has an include which is a page the returns the new data as well as all previous that that meet the query requirements.  I need to have a "page loading..." place holder while the query is being run.  We have shared internet at my office so it is a bit difficult to get actual code to this site

The returning page is roughly structured as follows:

<DIV><LOADING IMAGE><DIV>
<INSERT STATEMENT>
<INCLUDE STATEMENT> (QUERY RESULTS)
<HIDE DIV JAVASCRIPT> (THIS DOES NOT WORK FROM THE WHEN THE PAGE IS LOADED INTO THE MAIN DIV WHERE THE FORM WAS ORIGINALLY SUBMITTED)
0
 
LVL 41

Accepted Solution

by:
HonorGod earned 500 total points
Comment Utility
Ah, I would put a call to the "Hide()" routine in the Ajax callback routine, when it determines that the Ajax call is complete (i.e., when the HTTP Response readyState == 4 && the status == 200).

Does this make sense?
0
 
LVL 16

Expert Comment

by:CWS (haripriya)
Comment Utility
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now