Solved

Conditional statement code correction

Posted on 2013-06-11
2
275 Views
Last Modified: 2013-06-11
Please correct this code.  The conditional statement appears as text on the page, and it isn't executed...

<script type="text/javascript">
if(!TestforTouchScreen() )
{document.write ('function init() {alert("Sorry, there is no vacancy.  Please try alternative dates, or contact us for assistance.");}window.onload = init;');}
</script>
0
Comment
Question by:ddantes
2 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 250 total points
ID: 39240143
<script type="text/javascript">
if(!TestforTouchScreen() )
{document.write ('<script>function init() {alert("Sorry, there is no vacancy.  Please try alternative dates, or contact us for assistance.");}window.onload = init;<\/script>');}
</script>

Open in new window

0
 

Author Closing Comment

by:ddantes
ID: 39240199
Perfect.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I have answered several questions lately that were solved utilizing the power of jQuery's AJAX functions, so I thought I would write an article demonstrating the ease of use. Why should I use jQuery as opposed to regular JavaScript? Now I know…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
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…

757 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

17 Experts available now in Live!

Get 1:1 Help Now