Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Javascript won't run inside of DIV

Posted on 2009-07-07
6
Medium Priority
?
213 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

618 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