Solved

Javascript won't run inside of DIV

Posted on 2009-07-07
6
207 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

821 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