JavaScript - Javascript Conflicts In <head>
On one of my pages, I have a dropdown menu as well as a image rotator.
The problem is that when I have the menu on a page by itself, it loads like this: Not only does it have arrows, it also loads with a fade in/out. This is what I want. However, when both menu and image rotator scripts are in the head, this is the result: it doesnt have the arrows and doesnt fade in/out. Could someone point out where the two scripts come into conflict and possibly a resolution? Here is the code in the head: Code: <!--main stylesheet--> <link rel="stylesheet" type="text/css" href="css/main.css"> <!--menu stylesheets--> <link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen"> <script type="text/javascript" src="js/jquery-1.2.6.min.js"></script> <script type="text/javascript" src="js/hoverIntent.js"></script> <script type="text/javascript" src="js/superfish.js"></script> <script type="text/javascript"> // initialise plugins $(document).ready(function(){ $("ul.sf-menu").superfish(); }); </script> <!--Orbit stylesheets--> <!-- Use the ID of your slider here to avoid the flash of unstyled content --> <style type="text/css"> #featured { width: 940px; height: 450px; background: #009cff url('orbit/loading.gif') no-repeat center center; overflow: hidden; } </style> <link rel="stylesheet" href="orbit.css"> <!--[if IE]> <style type="text/css"> .timer { display: none !important; } div.caption { background:transparent; filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,endColorstr=#99000000); zoom: 1; } </style> <![endif]--> <!-- Attach necessary scripts --> <script type="text/javascript" src="js/jquery-1.4.1.min.js"></script> <script type="text/javascript" src="js/jquery.orbit.min.js"></script> <!-- Run the plugin --> <script type="text/javascript"> $(window).load(function() { $('#featured').orbit({ 'bullets': true, 'timer' : true, 'animation' : 'horizontal-slide' }); }); </script> Similar TutorialsFor a widget I made, I have a dropdown select menu. It is constrained to a very small width and IE does not auto expand on click. I wrote a simple javascript to handle this but I run into two problems. The onmouseout function is fired when I click into a child node, and the onmousedown of the <option> tags doesn't work in IE. The code works fine in all other browsers. var wid; var campaign_i = 0; function campaignWidget_capture(myID){ wid=document.getElementById(myID).style.width; campaign_i++; } function campaignWidget_SubDes(myID,state){ if(state==0){ if(campaign_i==0) campaignWidget_capture(myID); document.getElementById(myID).style.width="auto"; }else document.getElementById(myID).style.width=wid; } onmouseout="campaignWidget_SubDes(id,1)" This is in the select tag. onmousedown="campaignWidget_SubDes(id,0)" This is in the select tag onmousedown="campaignWidget_SubDes('campaignWidget_Sub_Designation',1)" This is in the option tag. I have been given the task of merging all of the javascript of 3 different websites into one file. I think that some of the JS is conflicting, but I don't know. I am not that experienced with JavaScript. Some of the JS is using jQuery. I have multiple anonymous jQuery functions: Code: (function ($) { // Javascript code })(jQuery) Notepad++ tells me there are 7 instances of: Code: (function (a) I am guessing there is no doubt that would cause conflict? What are some common things that cause conflicts in JavaScript? Hi Guys, i'm a complete amateur when it comes to js so would appreciate your help! I'm trying to implement two different JQuerys at the same time (vertical scrolling & shadowbox). When I try one of them on its own, it works fine, however when I add the second coding, it all stops working! I''ve read a few forums suggesting solutions, but frankly I don't really understand it!! Here is the HTML coding: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link href="css/stylesheet.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" type="text/css" href="css/shadowbox.css" /> <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> </head> <body onload="MM_preloadImages('images/btns/header_hyperlinks/contactus(2).png','images/btns/header_hyperlinks/about(2).png','images/btns/header_hyperlinks/hire(2).png','images/btns/header_hyperlinks/specialevents(2).png','images/btns/header_hyperlinks/latestnews(2).png','images/btns/header_hyperlinks/whatson(2).png','images/btns/header_hyperlinks/home(2).png','images/btns/header_hyperlinks/tickets(2).png','images/whatson_imgs/tickets_btn(2).png','images/whatson_imgs/calender_btn(2).png')"> <div id="header"> <div id="header_btns"> <div class="b1"><ul class="nav"><a href="#container" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home_btn','','images/btns/header_hyperlinks/home(2).png',1)"><img src="images/btns/header_hyperlinks/home(1).png" name="home_btn" width="70" height="19" border="0" id="home_btn" /></ul></a></div> <div class="b1"><ul class="nav"><a href="#whatson_container" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('whatson_btn','','images/btns/header_hyperlinks/whatson(2).png',1)"><img src="images/btns/header_hyperlinks/whatson(1).png" name="whatson_btn" width="113" height="19" border="0" id="whatson_btn" /></ul></a></div> <div class="b1"><ul class="nav"><a href="#latestnews_container" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('latest_btns','','images/btns/header_hyperlinks/latestnews(2).png',1)"><img src="images/btns/header_hyperlinks/latestnews(1).png" name="latest_btns" width="132" height="19" border="0" id="latest_btns" /></ul></a></div> <div class="b1"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('special_btn','','images/btns/header_hyperlinks/specialevents(2).png',1)"><img src="images/btns/header_hyperlinks/specialevents(1).png" name="special_btn" width="156" height="23" border="0" id="special_btn" /></a></div> <div class="b1"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('tickets_btn','','images/btns/header_hyperlinks/tickets(2).png',1)"><img src="images/btns/header_hyperlinks/tickets(1).png" name="tickets_btn" width="81" height="19" border="0" id="tickets_btn" /></a></div> <div class="b1"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('hire_btn','','images/btns/header_hyperlinks/hire(2).png',1)"><img src="images/btns/header_hyperlinks/hire(1).png" name="hire_btn" width="50" height="19" border="0" id="hire_btn" /></a></div> <div class="b1"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('about_btn','','images/btns/header_hyperlinks/about(2).png',1)"><img src="images/btns/header_hyperlinks/about(1).png" name="about_btn" width="203" height="19" border="0" id="about_btn" /></a></div> <div class="b2"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contact_us','','images/btns/header_hyperlinks/contactus(2).png',1)"><img src="images/btns/header_hyperlinks/contactus(1).png" name="contact_us" width="120" height="19" border="0" id="contact_us" /></a></div> </div> </div> <div id="container"> <div id="logo"> <img src="images/logo.png" /> </div> </div> <div class="wrapper"> <div class="seperator"> <img src="images/blank.png" height="100%" /> </div> <br /><a href="#" class="hyperlink">Read more..</a> </h3> </div> <div class="news_sections"> </div> <div class="news_sections2"> </div> </div> </div> </body> <!-- ================== JAVASCRIPT FOR THE SCROLLING ================== --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.easing.1.3.js"></script> <script type="text/javascript"> $(function() { $('ul.nav a').bind('click',function(event){ var $anchor = $(this); $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top }, 1500,'easeInOutExpo'); /* if you don't want to use the easing effects: $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top }, 1000); */ event.preventDefault(); }); }); </script> <!-- ================== END OF JAVASCRIPT FOR THE SCROLLING ================== --> <!-- ================== JAVASCRIPT FOR THE SHADOWBOX ================== --> <script type="text/javascript" src="js/jquery.js" /></script> <script type="text/javascript" src="js/shadowbox.js"></script> <script type="text/javascript"> Shadowbox.init(); function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> <!-- ================== END OF JAVASCRIPT FOR THE SHADOWBOX ================== --> </html> Your help will be much appreciated! First of all I really appreciate you reading this. Im going to try to be detailed so I can get help... I have wasted over 8 hours on this already and I'm going to (scuse my french) f'ing lose my mind. I'm about ready to pay someone... if youre intersted PM me. So, I have a wordpress blog that came with several javascript includes already in the header related to the features of the blog. These features include a gallery which has little popups over the images on mouseover. the includes were 'jquery.min.js', and 'script.js' (in that order) followed by a few other includes for other features. That works fine, but then I wanted to replace the menu with a different menu which uses lavalamp jquery (he http://www.gmarwaha.com/blog/2007/08...jquery-lovers/ ) For the new menu, it requires jquery.min.js and 'custom.js'. I took out jquery.min because it was redundant and put custom underneath 'script.js' in the header. I got the menu working, except then I noticed the gallery rollovers stopped working. I moved around the order of the different includes in the header, then neither worked. after I fiddled with it more, the menu stopped working but the gallery would work. After Screwing with this for an awful long time, and a process of elimination, i found that wp_head was causing problems (where it hooks in the headers for all my wordpress plugins). I then realized 'cforms' was using jquery, as well as contact form 7, and I figured they must be conflicting somehow. So I temporarily commented out wp_head so I could focus on the other elements first, and getting them working. At this point (5 hours or so) I decided it must be something in script.js as well as custom.js which are conflicting. I have NO idea of anything about javascript so I started by going through script.js (for the gallery) and through a process of elimination i deleted all the functions that would stop it from working. my thought process was i could then do the same to custom.js (for the menu) and then hopefully with both of them trimmed everything would not conflict. So.. i opened the js file, literally removed ONE function (completely unrelated) to the gallery.. it was something about validating a contact form, and was only like 5 lines of code, and suddenly the gallery doesnt work ... GRRRRRRRRRRRRRRRR I am now at a complete loss of what to do.. i really need this working and I must not be doing something right. I dont understand how one function COMPLETELY unrelated to another will ruin everything. Please PM me if interested, i'm willing to pay someone to fix this here are the files in case you need them heres my header first. I have tried every possible combination of wher to put the different files by the way, no dice Code: <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS" href="<?php bloginfo('rss2_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" /> <link href="<?php bloginfo('template_directory'); ?>/menu.css" rel="stylesheet" type="text/css" /> <link href="<?php bloginfo('template_directory'); ?>/style1.css" rel="stylesheet" type="text/css" /> <!-- commented out while I try to figure this out <script type='text/javascript' src='<?php bloginfo('template_directory'); ?>/custom.js'></script> --> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/script/jquery.min.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/script/script.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/script/superfish.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/script/fader.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/script/jquery.prettyPhoto.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/script/cufon-yui.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/script/Andika_Basic_400.font.js"></script> Hi, The following code works: Code: <html> <head> <style type="text/css"> img { opacity:0.4; filter:alpha(opacity=40); } </style> </head> <body> <img src="http://www.w3schools.com/Css/klematis.jpg" width="150" height="113" alt="klematis" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40" /> <img src="http://www.w3schools.com/Css/klematis2.jpg" width="150" height="113" alt="klematis" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40" /> </body> </html> But the problem is you have to repeat the inline JavaScript for all <img> tags. I tried to put the script in the head to no avail: Code: <html> <head> <style type="text/css"> img { opacity:0.4; filter:alpha(opacity=40); } </style> <script type="text/javascript"> function getElements() { var x=document.getElementsByTagName("img"); x.style.opacity=1; x.filters.alpha.opacity=100; } </script> </head> <body> <img src="http://www.w3schools.com/Css/klematis.jpg" width="150" height="113" alt="klematis" onmouseover="getElements()" onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40" /> <img src="http://www.w3schools.com/Css/klematis2.jpg" width="150" height="113" alt="klematis" onmouseover="getElements()" onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40" /> </body> </html> Everything seems right to me, but it doesn't work. Many thanks for any help! Mike can I use javascipt to put in perl <head> for description. what I want to do is something like this <head> <script type="text/javascript"> if $description != (not == to)" " { <meta name="description" content=" $description"> } else { <meta name="description" content=" my site"> } </scipt> </head> <body> run the java script </body> thanks. I am trying something like Code: <script type=\"text/javascript\"> var description == \"mysite\"; if(description != \"$description\"){ document.write(\"<meta name=\"description\" content=\"mysite\">\"); }else{ document.write(\"<meta name=\"description\" content=\"$description\">\"); } </script> Hello, I'm having trouble with some scripts conflicting and interrupting my animation. I have a small website build around Joomla and I do my own modules and components.. I've made a simple browser game that uses Javascript's setInterval to highlight some elements. A few days ago I decided to add some advertising banners to cover the server costs but those banners are using Javascript and are interrupting my "game"... Is there a way to stop that from happening ? The script flow goes like this... Step 1. An XMLHttpRequest is being made and the server returns X numbers of elements out of Y total elements that need to get highlighted. Step 2. The elements default state is "blank" then a loop goes through the Y elements and sets a className of "highlight" on the elements that need to get highlighted. Step 3. The setInterval is being called and executes the code that highlights the X elements on every interval. Code: mytimer = setInterval ( animation, 500 ); The animation variable holds a function that changes the elements with class "highlight" to "highlighted". Some pseudo-code: Code: // After all the AJAX requests and more doodle codes... while(i < num_arr.length) { // num_arr holds the X numbers to get marked as highlight document.getElementsByTagName('td').item(X).setAttribute('name', 'highlight'); i++; } mytimer = setInterval ( animation, 500 ); var animation = function() { document.getElementsByTagName('td').item(X).className = 'highlighted'; // There is an "if" check to kill the setInterval if no more Xs are found clearInterval(mytimer); } * The above code is just a short example of the actual script * Any help would be much appreciated.. Thank you. Ok my lab6 at http://opentech.durhamcollege.ca/~in...rittains/labs/ is conflicting with my interface as it is php... is there a better way for me to do this that will allow it to not conflict? PHP Code: <?php $title = "Lab6"; include "head.php"; ?> <style type="text/css"> table, td, th { border: 1px solid red; } </style> <?php function convert($i) { $CtoF= 9.0/5.0*$i + 32; return $CtoF; } ?> <td> <?php $error = ""; $result = ""; if($_SERVER["REQUEST_METHOD"] == "GET") { $start = ""; $stop = ""; $increment = ""; } else if($_SERVER["REQUEST_METHOD"] == "POST") { $start = trim($_POST["startTemp"]); $stop = trim($_POST["stopTemp"]); $increment = trim($_POST["incrementTemp"]); if(!isset($start) || $start == "") { $error .= "<br/>Please enter number to declare a starting value."; } else if(!is_numeric($start)) { $error .= "<br/>The value entered <b>MUST</b> be a number, you entered: " . $start; $start = ""; } if(!isset($stop) || $stop == "") { $error .= "<br/>Please enter number to declare a ending value."; } else if(!is_numeric($stop)){ $error .= "<br/>The value entered <b>MUST</b> be a number, you entered: " . $stop; $stop = ""; } if(!isset($increment) || $increment == "") { $error .= "<br/>Please enter number to declare a increment value."; } else if(!is_numeric($increment)){ $error .= "<br/>The value entered <u>MUST</u> be a number, you entered: " . $increment; $increment = ""; } if($error == "") { $result .= "<table class='phpTable'>"; $result .= "<tr><th>Celsius</th>"; $result .= "<th>Fahrenheit</th></tr>"; for ($i = $start; $i <= $stop; $i += $increment) { $result .= "<tr><td>" . $i; $result .= "°</td><td>"; $result .= convert($i); $result .= "°</td></tr>"; } $result .= "</table>"; } else { $error .= "<br/>Please Try Again"; } } ?> <script type="text/javascript"> /*var error = "<?php echo $error; ?>"; document.getElementById('error').innerHTML = error; var result = "<?php echo $result; ?>"; document.getElementById('result').innerHTML = result;*/ </script> <h2 id="error"><?php echo $error; ?></h2> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" > Starting Temperatu <input type="text" name="startTemp" value="<?php echo $start; ?>" size="5"/> <br/> Stop Temperatu <input type="text" name="stopTemp" value="<?php echo $stop; ?>" size="5"/> <br/> Temperature Increment: <input type="text" name="incrementTemp" value="<?php echo $increment; ?>" size="5"/> <br/> <input type="submit" name="submit" value="Submit"/> </form> <h2 id="result"><?php echo $result; ?></h2> <?php include "foot.php"; ?> The assignment was supposed to be done in PHP. But I want to know if there is a better way either way. Like can I use AJAX instead of PHP to do that? or change the way the PHP works... something anything... Hello. I just added this javascript/css dropdown menu to my site (download came from here). Everything seemed to be going fine until I started to test it on other pages. It seems to be running into some sort of conflict on certain pages, but I have no idea why or how. All I can tell is that the page loads differently (it shows basically an un-styled site, then it loads) and that's when the conflict occurs. In short, the menu shows up about 50px below where it should, rendering it impossible to use. I don't care how it looks in IE. The only browser that is showing it correctly is Opera. Any help would be greatly appreciated. I have no idea. :/ http://www.surrealtwilight.com You'll have to login with "Reviewer" password "testingme" to see the layout I've been working on. Menu works fine on the index page and some other pages, but not for the website pages like st_rules.php and stuff like that. :/ Any help will be greatly appreciated. I love how it looks, and I'm super bummed it's doing this. This is probably stupid on my part so, I apologize in advance. I created a simple script/function that generates a popup window when you click on a link. The function writes the html code for a media player (the URL for which is passed to the function) depending on what link is clicked, and then creates a text link "Close" below the player. I've put the code below... BUT! Here's what's happening. I tested it on both Firefox and Google Chrome. (I could swear it was working on both once upon a time...but now just isn't...) In Chrome, the player is visible but the close link is not. In Firefox, the player is not visible(but you can find where it's at and pause/resume and etc.) The close link is visible. The audio file plays on both browsers. The window is supposed to have a black background, which is does in Firefox but for some reason it's blue in Chrome? (Minor issue..I know...) Quote: function pop(url) { var generator=window.open('','name','height=200,width=400,status=1'); generator.document.write('<html><head><title>Popup</title>'); generator.document.write('</head><body style="color:white;" bgcolor="#000">'); generator.document.write('<object width="300" height="200"><param name="src" value="' + url + '"><param name="autoplay" value="false"><param name="controller" value="true"><param name="bgcolor" value="#CCCCCC"><embed src="' + url + '" autostart="true" loop="false" width="300" height="200" controller="true" bgcolor="#CCCCCC"></embed></object>'); generator.document.write('<p><a style="color:white;" href="javascript:self.close()">Close</a> the popup.</p>'); generator.document.write('</body></html>'); generator.document.close(); } I can give you the URL for the thing so you can see it in action... http://thetabbfamily.com/cdpages/lifeisgood.php Scroll down 'Purchase Individuals' and click on one of the songs... I have a few hundred popups that I am trying to change to a "lightbox" style solution: Code: <!DOCTYPE html> <html> <head> <title>Test 1</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <script src="../../js/jquery.colorbox-min.js"></script> <link rel="stylesheet" href="../../css/colorbox5.css" media="screen"> <script src="../../js/ssm.js" type="text/javascript"></script> <script src="../../js/ssmitems3a.js" type="text/javascript"></script> <link rel="stylesheet" href="../../css/ssmitems.css" type="text/css"> <script> $(document).ready(function(){ $("a[rel='tip']").colorbox(); }); </script> </head> </script> <body> <a rel="tip" href="tip1(AC)2.html"><img border="0" src="../../img/tipani1.gif" width="50" height="74"></a> </body> </html> The new colorbox popup solution works well, but in some browsers - notably IE - it conflicts with the SIDE MENU routine I use. I think the menu is old code, but it works. However, to get the new "lightbox-style" popup to work in IE, I have to include <!DOCTYPE html>. In the other browsers, omitting the declaration apparently solves the conflict problem (but I feel it ought to be there). I really don't know what to do. Tinker with the side menu code? Here is a demo with the <!DOCTYPE html> declaration: http://www.aapress.com.au/ieltsonlin...conflict1.html ...and without it: http://www.aapress.com.au/ieltsonlin...conflict2.html I have tried with a full declaration but it makes no difference at all. And further reading online suggests <!DOCTYPE html> is OK. Does anyone spot a reason for the conflict? Is there a way to load up an external JS file outside of the head tag? I've got an "AJAX" web app that's loading several pages simply by changing the innerHTML property of a single div. The JS source is getting to be rather large, so I'd like to split it up into manageable, organized portions. Is there some way to, using javascript or PHP, load another javascript into the browser dynamically?
http://www.masterclock.com/newContac...help/david.php I have a page with 3 forms. I've got javascript making them appear and disappear with buttons at the top. I mostly copied this guy's form: http://tetlaw.id.au/view/javascript/...eld-validation I added some conditional checkboxes using wform javascript library. my problem is that i need my reset button to a)reset the fields and b)re-hide the conditional fields. It works with the sales form and the catalog form (the catalog from doesn't use the conditional fields) but for some reason the request a quote form is convinced .request isn't a function. Even though it is using the same function as the sales form only it is pushing it's form id to it. what the heck am i doing wrong? And how awful and waste of space is my code? Hello All, I am having a few issues. I have added a piece of code in and it doesn't seem to be working. I have highlighted this in bold. Any Ideas? <html> <body> <SCRIPT LANGUAGE="JavaScript"> <head> <TITLE>Find the Correct Number Game</TITLE> </head> a=(prompt('please enter your name:',0)); // prompt for player name document.write(' Hello ' ,a); var guessme=Math.round(Math.random()*(49)+1); var speech='Choose a number between 1 and 50'; function process(hiddennumber) { var guessnumber=document.forms.guesstable.guessnumber.value; var speech='"'+guessnumber+ '" Letters are not allowed. Please enter digits only!.'; document.forms.guesstable.guessnumber.value=''; if (guessnumber==hiddennumber) { document.forms.guesstable.prompt.value='Congratulations! '+hiddennumber+' is correct!'; alert ('Well done - the mystery number is '+hiddennumber+'! \n\nIf you want to play again click the button.'); speech=''; document.location=document.location; } if (hiddennumber<guessnumber) { speech='Less than '+ guessnumber; } if (hiddennumber>guessnumber) { speech='Greater than '+ guessnumber; } if (guessnumber=='') { speech='You didn\'t guess anything!' } document.forms.guesstable.prompt.value=speech; document.forms.guesstable.guessnumber.focus(); } </SCRIPT> </body> </html> <FORM onSubmit="" NAME="guesstable"> <CENTER> <TABLE ALIGN="left" BGCOLOR="#888889" BORDER="5" CELLPADDING="5"> <TR> <TD BGCOLOR="#004081"> <FONT COLOR="#ffffff" FACE="Arial"><B>Find the Correct Number</B></FONT> </TD> </TR> <TR> <TD> <CENTER> <INPUT TYPE="text" NAME="prompt" SIZE="31" MAXLENGTH="60" VALUE="Find the correct number which is between 1 and 50"><BR> <INPUT TYPE="text" NAME="guessnumber" SIZE="3" MAXLENGTH="3" VALUE=""> <INPUT TYPE="button" VALUE="Enter" onClick='process(guessme)'> </CENTER> </TD> </TR> </TABLE> </CENTER> </FORM> Hello, I am new here. I am having problems with a talking head video on my website www.getvms.com. A young woman pops up and speaks and then when you click on her a form to fill out is supposed to pop up. It works perfect in chrome and FF, but in IE the video just closes. Can someone tell me why that is? Or at least some type of direction? I found that when the script is in there twice it works, but of course that cause the video to echo. Here is the code for the page.... Code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head> <meta name="verify-v1" content="+E5zkaC6JxDkzTZkPgdW9Gmj8aIXPzDPpIpeBsUDi0s=" > <title>VMS - Velocity Merchant Services - Downers Grove, IL</title><meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <meta name="description" content="Velocity Merchant Services of Downers Grove, IL offers credit card processing for Visa, MasterCard, American Express, and Discover allowing businesses to accept credit cards and debit cards."> <meta name="keywords" content="VMS, Velocity Merchant Services, Credit Card Terminals, Downers Grove Merchant Services, Oakbrook Merchant Services, Accept Credit Cards, Accept Debit Cards, Credit Card Processing, Merchant Service Provider, Merchant Card Services, Downers Grove Business Service, Oakbrook Business Service"> <meta http-equiv="content-language" content="en-us"> <meta name="robots" content="index,follow"> <meta name="googlebot" content="index, follow"> <meta name="revisit-after" content="10 days"> <meta name="author" content="Velocity Merchant Services - VMS"> <link href="style.css" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="menu/imenus0.css" type="text/css"> <link rel="stylesheet" href="cssverticalmenu.css" type="text/css"> <script src="swfobject.js" type="text/javascript"></script> <link rel="icon" href="/favicon.ico" type="image/x-icon"> </head> <body> <div id="container"> <div id="logo"><img src="images/logo.gif" alt="Logo"></div> <table width="781" border="0" align="center" cellpadding="0" cellspacing="0" style=" margin-top:10px; background:url(images/nav-bkgd.gif) no-repeat center top;"> <tr> <td><script language="JavaScript" src="menu/imenus0.js" type="text/javascript"></script></td> </tr> </table> <table width="781" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="781" colspan="3"> <div id="flasher"><img src="images/photo-home.jpg" alt="Velocity Merchant Services" width="781" height="164"></div> <script type="text/javascript"> var so = new SWFObject("flash_final.swf", "flash_content", "781", "222", "8"); so.addParam("wmode","transparent"); so.write("flasher"); </script></td> </tr> </table> <table width="781" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td width="381" valign="top"><a href="about.html" onMouseOver="Tip('<b>Phone:</b> <br> (888) 902.6227 <br> <br> <b>Address:</b> <br> Velocity Merchant Services <br> 3051 Oak Grove Dr. (Second Floor) <br> Downers Grove, IL 60515')"> <h3> Welcome To Velocity Merchant Services </h3> Velocity Merchant Services </a> is a direct processor for Visa, MasterCard, American Express and Discover. Offering multiple payment options for your customers is the first step to increasing your company's cash flow.</p> <p>At VMS we will not only approve you to accept credit cards and debit cards from your customer; but we will help implement proven marketing strategies to help your business grow!<span class="style1"><br> </span></p> </td><td width="380" valign="top"><h3> Are You PCI Compliant?</h3> <P>Make sure your business is compliant with the latest PCI (Payment Card Industry) Data Security Standards to ensure your customers' confidential information is trasmitted in the most secure environment possible. <a href="/pci">Take our quick survey</a> and avoid non-compliance penalties.</P> <P><a href="/pci"><u>Take The PCI Compliance Survey</u></a>!</P> </td> </tr> <tr> <td colspan="2" valign="top"> </td> </tr> </table> <table width="781" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="196" align="center" valign="top"><table width="191" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top" class="mainmenu" style="background-image:url(images/box-top.gif); background-position:top"><h2><a href="agent-services.html">Agent Services</a></h2></td> </tr> <tr> <td valign="top" style="background-image:url(images/box-bkgd.gif); background-position:top center; background-repeat:no-repeat;"> <div class="List"> <ul> <li><a href="become-a-partner.html">Become a Partner</a></li> <li><a href="value-added-services.html">Programs & Services</a></li> <li><a href="login.html">ISO Sales Agent Sign Up</a></li> <li><a href="news.html">News</a></li> <li><a href="resource-center.html">Resource Center</a></li> <li><a href="careers.html">Careers</a></li> </ul> </div> </td> </tr> </table> </td> <td width="195" align="center" valign="top"><table width="191" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top" class="mainmenu" style="background-image:url(images/box-top.gif); background-position:top"><h2><a href="existing-merchants.html">Existing Merchants</a></h2></td> </tr> <tr> <td align="center" valign="top" style="background-image:url(images/box-bkgd.gif); background-position:top center; background-repeat:no-repeat;"> <div class="List"> <ul> <li><a href="service-upgrade.html">Service Upgrades / Additions</a></li> <li class="list-spacing"><a href="customer-service.html">Tech Support / Customer Service</a></li> <li><a href="order-free-supplies.html">Order Free Supplies</a></li> <li><a href="american-express-card.html">American Express Card</a></li> <li><a href="referralprogram.html">Referrals</a></li> <li><a href="faq.html">FAQ's</a></li> </ul> </div></td> </tr> </table></td> <td width="195" align="center" valign="top"><table width="191" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top" class="mainmenu" style="background-image:url(images/box-top.gif); background-position:top"><h2><a href="value-added-services.html">Value Added Services</a></h2></td> </tr> <tr> <td align="center" valign="top" style="background-image:url(images/box-bkgd.gif); background-position:top center; background-repeat:no-repeat;"> <div class="List"> <ul> <li><a href="vms-fast-cash.html">Cash Advances</a></li> <li><a href="gift-cards.html">Gift Cards</a></li> <li><a href="web-development.html">Web Development</a></li> <li><a href="check-services.html">Guarantee Check Service</a></li> <li><a href="eletronic-benefits-transfer.html">Electronic Benefit Transfer</a></li> <li><a href="business-cards.html">Business Cards</a></li> <li><a href="http://www.getvms.com/icharge/">iCharge</a></li> </ul> </div></td> </tr> </table></td> <td width="195" align="center" valign="top"><table width="191" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top" class="mainmenu" style="background-image:url(images/box-top.gif); background-position:top"><h2><a href="merchant-services.html">Merchant Services</a> </h2></td> </tr> <tr> <td align="center" valign="top" style="background-image:url(images/box-bkgd.gif); background-position:top center; background-repeat:no-repeat;"> <div class="List"> <ul> <li><a href="retail.html">Retail</a></li> <li><a href="restaurant.html">Restaurant</a></li> <li><a href="health-pharmaceuticals.html">Health/Pharmaceuticals</a></li> <li><a href="service.html">Service</a></li> <li><a href="mail-order.html">Mail Order / Telephone Order</a></li> <li><a href="ecommerce.html">eCommerce</a></li> </ul> </div></td> </tr> </table></td> </tr> </table> <br> <table width="781" border="0" align="center" cellpadding="20" cellspacing="0" style="background-image:url(images/footer-bkgd.gif); background-repeat:no-repeat" id="footer"> <tr> <td width="541" align="center" valign="middle"><p><a href="index.html">Home</a> :: <a href="about.html">About VMS</a> :: <a href="merchant-services.html">Merchant Services</a> :: <a href="web-development.html">Web Development</a> :: <a href="vms-fast-cash.html">Cash Advances</a><br> <a href="credit-card-terminals.html">Credit Card Terminals</a> :: <a href="request-information.php">Request Info</a> ::<a href="contact.html"> Contact</a> :: <a href="privacy-policy.html">Privacy Policy</a></p> <p>© 2010 Velocity Merchant Services. VMS is a registered ISO and MSP of HSBC Bank, USA<br> National Association, Buffalo, NY</p></td> <td width="160" align="center" valign="middle"><p>Velocity Merchant Services<br> 3051 Oak Grove Road<br> Downers Grove, IL 60515<br> Phone: (888) 902.6227<br> Fax: (888) 902.6229</p></td> </tr> </table> <br> <table align="center" width="781" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left"><table border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle"><a href="application.php"><img src="images/creditcards.jpg" alt="Apply Now!" border="0"></a></td> </tr> </table> <p> </p></td> <td align="right"><table border="0" cellspacing="0" cellpadding="0"> <tr> <td><a rel="nofollow" target="_blank" href="http://www.bbbonline.org/cks.asp?id=1061023114246"><img src="images/bbb.gif" alt="Click to verify BBB accreditation and to see a BBB report." width="40" height="64" border="0" title="Click to verify BBB accreditation and to see a BBB report."></a></td> <td style="padding: 0 15px"><a href="http://www.uschamber.com/sb" rel="nofollow" target="_blank"><img src="http://www.uschamber.com/sb/websticker/image.asp?i=a2&m=999999" alt="U.S. Chamber of Commerce Member 2008" hspace="10" title="U.S. Chamber of Commerce Member 2008"></a></td> <td><script type="text/javascript" src="http://sealserver.trustkeeper.net/compliance/seal_js.php?code=w6otlmrNfNOhkhjNVXmBsFWOX2IVM8&style=normal&size=105x54&language=en"></script> <noscript> <a href="https://sealserver.trustkeeper.net/compliance/cert.php?code=w6otlmrNfNOhkhjNVXmBsFWOX2IVM8&style=normal&size=105x54&language=en" rel="nofollow" target="hATW"><img src="http://sealserver.trustkeeper.net/compliance/seal.php?code=w6otlmrNfNOhkhjNVXmBsFWOX2IVM8&style=normal&size=105x54&language=en" alt="Trusted Commerce" border="0"></a> </noscript></td> <td width="179"> <a href="docs/ViewComplianceCertificate.action.pdf" rel="nofollow" target="_blank"><img src="images/compliance%20icon.jpg" width="175" height="74" border="0" align="right" alt="Compliance"></a></td> </tr> </table> <table align="right"><tr><td><p> <!-- <a href="http://jigsaw.w3.org/css-validator/check/referer"> <img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> </a>--> </p></td><td> <p> <!--<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional" height="31" width="88" border="0"></a>--> </p></td></tr></table> </td> </tr> </table> <script language="JavaScript" src="menu/ocscript.js" type="text/javascript"></script> <script language="JavaScript" src="wz_tooltip.js" type="text/javascript"></script> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-4568625-2"); pageTracker._initData(); pageTracker._trackPageview(); </script> <script language="javascript" type="text/javascript" src="wthvideo/wthvideo.js"></script> </div> </body> </html> for the javascript.... Code: // Copyright 2010 Website Talking Heads // JavaScript Document if (typeof wthvideo == 'undefined') { wthvideo = new Object(); } wthvideo.params = { width:272, height:384, position:"fixed", doctype:"strict", left:"auto", right:"0px", top:"auto", bottom:"0px", centeroffset:"auto", color:0x022918, volume:70, autostart:"yes", fadein:1, fadeout:2, delay:0, delayclose:5, buffertime:3, playbtn:"PlayVideo.png", playposition:"right", playtop:"bottom", exitoncomplete:"yes", oncepersession:"no", vidlink:"http://www.getvms.com/request-information.php", openin:"_blank", path:"wthvideo", actorpic:"rennygetvms3410.png", flv:"rennygetvms3410.flv" }; var topPx = parseFloat(wthvideo.params.top); var bottomPx = parseFloat(wthvideo.params.bottom); wthvideo.hideDiv = function(){ document.getElementById('wthvideo').style.visibility = 'hidden'; } function onlyOnce() { if (document.cookie.indexOf("hasSeen=true") == -1) { var later = new Date(); later.setFullYear(later.getFullYear()+10); document.cookie = 'hasSeen=true;path=/;'; wthvideo.drawVideo(); } } if (navigator.appName.indexOf("Microsoft") != -1) { var topWth = 577; } else { var topWth = 582; } wthvideo.drawVideo= function(){ var markUp = ''; markUp += '<style type="text/css">'; markUp += '#wthvideo {position:'+wthvideo.params.position+';width:'+wthvideo.params.width+'px;height:'+wthvideo.params.height+'px;margin-left:'+wthvideo.params.centeroffset+';left:'+wthvideo.params.left+';right:'+wthvideo.params.right+';top:'+wthvideo.params.top+';bottom:'+wthvideo.params.bottom+';z-index:99999999999;}'; markUp += '</style>'; markUp += '<div id="wthvideo">'; markUp += ' <object id="objvideo" style="outline:none;" type="application/x-shockwave-flash" width="'+wthvideo.params.width+'" height="'+wthvideo.params.height+'" data="'+wthvideo.params.path+'/wthplayer.swf">'; markUp += ' <param name="movie" value="'+wthvideo.params.path+'/wthplayer.swf" />'; markUp += ' <param name="quality" value="high" />'; markUp += ' <param name="flashvars" value="vurl='+wthvideo.params.flv+'&vwidth='+wthvideo.params.width+'&vheight='+wthvideo.params.height+'&actorpic='+wthvideo.params.path+'/'+wthvideo.params.actorpic+'&autostart='+wthvideo.params.autostart+'&exitoncomplete='+wthvideo.params.exitoncomplete+'&vbuff='+wthvideo.params.buffertime+'&vdelay='+wthvideo.params.delay+'&vcolor='+wthvideo.params.color+'&vlink='+wthvideo.params.vidlink+'&openin='+wthvideo.params.openin+'&delayclose='+wthvideo.params.delayclose+'&fadein='+wthvideo.params.fadein+'&fadeout='+wthvideo.params.fadeout+'&vvol='+wthvideo.params.volume+'&playbtn='+wthvideo.params.path+'/'+wthvideo.params.playbtn+'&playpos='+wthvideo.params.playposition+'&playtop='+wthvideo.params.playtop+'" />'; markUp += ' <param name="wmode" value="transparent" />'; markUp += ' <param name="allowscriptaccess" value="always" />'; markUp += ' <param name="swfversion" value="9.0.45.0" />'; markUp += ' </object>'; markUp += '</div>'; markUp += '<div id="highlightWth" style="position:absolute; width:150px; height:30px; left:50%; top:'+topWth+'px; visibility:hidden">'; markUp += '<img src="wthvideo/orangecircledrawn.png">'; markUp += '</div>'; if (wthvideo.params.position == "fixed") { if (wthvideo.params.doctype == "quirks") { if (wthvideo.params.top == "auto") { markUp += '<!--[if IE]>'; markUp += '<style type="text/css">'; markUp += '#wthvideo {position:absolute; top: expression(offsetParent.scrollTop - 1 + (offsetParent.clientHeight-this.clientHeight) + '+bottomPx+' + "px")}'; markUp += '</style>'; markUp += '<![endif]-->';} else { markUp += '<!--[if IE]>'; markUp += '<style type="text/css">'; markUp += '#wthvideo {position: absolute !important;top: expression(((document.documentElement.scrollTop || document.body.scrollTop) + (!this.offsetHeight && 0)) + '+topPx+' + "px")'; markUp += '</style>'; markUp += '<![endif]-->';} } else { markUp += '<!--[if lte IE 6]>'; markUp += '<style type="text/css">'; markUp += 'html, body{height: 100%;overflow: auto;}#wthvideo {position: absolute;}'; markUp += '</style>'; markUp += '<![endif]-->'; } } document.write(markUp); } function hideDiv() { wthvideo.hideDiv(); } if (wthvideo.params.oncepersession == "yes") { onlyOnce();} else { wthvideo.drawVideo(); } function thisMovie(movieName) { if (navigator.appName.indexOf("Microsoft") != -1) { return window[movieName]; } else { return document[movieName]; } } function cue0Bright() { document.getElementById('highlightWth').style.visibility = 'visible'; } function cue0Normal() { document.getElementById('highlightWth').style.visibility = 'hidden'; } function cue0() { cue0Bright(); setTimeout("cue0Normal();", 3000); } function cue1Bright() { document.getElementById('highlightWth').style.visibility = 'visible'; document.getElementById('highlightWth').style.top = topWth+38+'px'; } function cue1Normal() { document.getElementById('highlightWth').style.visibility = 'hidden'; } function cue1() { cue1Bright(); setTimeout("cue1Normal();", 1500); } function cue2Bright() { document.getElementById('highlightWth').style.visibility = 'visible'; document.getElementById('highlightWth').style.top = topWth+19+'px'; } function cue2Normal() { document.getElementById('highlightWth').style.visibility = 'hidden'; } function cue2() { cue2Bright(); setTimeout("cue2Normal();", 4000); } I need to get this figured out fairly quickly. As I said the pop-ups work in FF and Chrome, but in IE the program just closes. I am very new to learning JavaScript and I already seem to have come across a problem. I can get Scripts to work fine in the <body> but not all scripts seem to work in the <head> For example, this works fine: Code: <html> <body> <p id="date"></p> <script type="text/javascript"> <!-- document.getElementById('date').innerHTML = Date(); //--> </script> </body> </html> However, it won't work if I place the script in the head like this: Code: <html> <head> <script type="text/javascript"> <!-- document.getElementById('date').innerHTML = Date(); //--> </script> </head> <body> <p id="date"></p> </body> </html> It could just be that I broke one of the fundamental laws of coding that I don't know or something but like I said, I've only just started JavaScript. Also, the tutorial I have isn't to clear on the differences between using the <head> or the <body>. Just kinda says you can do both. I'd like to use the <head> wherever possible because it would be so much neater to keep all the JavaScript in one place and all the HTML in another. Pretty much like you can do with CSS. Anyway, I'd be much grateful if somebody can explain this to me. This is really annyoing. I'm trying to set up an image's source from a function within the document's head, but to no avail. The code is something like this: ------------------------------------------------------- <head> .....js code..... function updatePieChart() { document.pie_chart.src = "piechart.php?p1&p2"; // php-generated image, with parameters } // A FUNCTION WHICH SUCCESSFULLY RUNS EVERY 2-3 SECONDS function ajax() { ....stuff..... // THE NEXT LINE DOESN'T WORK!!! // updatePieChart(); ...stuff..... } ....js code...... // THE NEXT LINE DOESN'T WORK!!! // updatePieChart(); </head> //THIS LINE WORKS LIKE A CHARM <body onload="updatePieChart();"> ....bla bla bla... <img src="#" name="pie_chart" /> ...bla bla bla.... </body> ------------------------------------------------------- As you can see, the function updatePieChart works wonderfully from the <body> tag of the function, but any attempt to call it from within the <head> tags fails. Also, I've tried to change the function updatePieChart so that it wouldn't call any php code and changed it to a simple document.pie_chart.src = "#"; but that still causes errors on the page when called from inside the <head> tags. On the other hand, if the function updatePieChart merely made an alert() call, then the ajax element works fine, and every so and so seconds I get an alert. Anyone, help? An explanation how come I can't set the image from within the <head> tags? Hello and thanks for letting me on this forum! Im pretty new to JScript and I am still getting used to it all. I am trying to make a Website that allows values to be selected from one form, transferred to the next form as a summary and then completed. The values are sent to the page fine but my Validation is broken. Here is my LINK code In the Form Code: <form id="Tickets" onsubmit="return ValidateForm()" action="Details.html"> And in the Submit Button Code: <input type="submit" id="OrderTickets" value="Order Tickets" onclick="return ValidateForm()" > My validation is as follows Code: <script type = "text/javascript"> function ValidateForm() { if( document.getElementById('DepartingStation').selectedIndex == " ") { alert( "Please provide a Departing Station!" ); document.getElementById('DepartingStation').focus() ; return false; } if( document.getElementById('ArrivingStation').selectedIndex == " ") { alert( "Please provide an Arriving Station!" ); document.getElementById('ArrivingStation').focus() ; return false; } var Depart = document.getElementById('DepartingStation').value; var Arriv = document.getElementById('ArrivingStation').value; if( Depart==Arriv){ alert( "Train cannot depart and arrive at the same station!" ); return false; } if ( document.getElementById('ReturnTravel').checked=true; { var valueDate = document.getElementById('OutwardDate').value; if ( valueDate== null || valueDate== '') { alert('Please provide an Outward Travel Date!'); return false; } } var valueRetDate = document.getElementById('ReturnDate').value; if ( document.getElementById('ReturnTravelType').checked==true && (valueRetDate== null || valueRetDate== '' )) { alert('Please provide a Return Travel Date!'); return false; } } Id appreciate any help anyone can share on this! Thanks. I have an external .js file that ends its process with a document.write() command. This needs to be called near the end of the HTML page, right before </body>. Am I better off calling the external .js at the desired location in the footer? Or making the .js into a defined function, loading the .js in the <head> portion and then executing the function in the footer? - M. I need the index of an element in a numeric array. I have tried several variations, but all of them return a undefined value. I can look at the dom and see that the value is there, but the code isn't finding it, please help. Code: Array.prototype.indexValue =function (s){ var index = 'It is not here'; for (var i=0; i<orderArray.lenght; i++){ if (orderArray[i] == s){ return i; } } return index; } function move(){ //get the array posstion of the page in the order array var gpid = 38; var num = orderArray.indexValue(gpid); alert(num); } var orderArray=[28,32,38,45,65]; For me, every time it returns, "It is not here". Help. TIA, Adam |