Solved

Javascript won't run inside of DIV

Posted on 2009-07-07
6
204 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
ID: 24798189
Can you include some code that shows what you're trying to do?
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 24798632
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
ID: 24803417
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
ID: 24804096
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)
ID: 37304482
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
This article discusses how to create an extensible mechanism for linked drop downs.
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…

932 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

12 Experts available now in Live!

Get 1:1 Help Now