Solved

Conditional statement code correction

Posted on 2013-06-11
2
281 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
The viewer will learn how to dynamically set the form action using jQuery.
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)

785 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