HTML - Swapping Two Working Objects Produces Syntax Error In Script
I basically have some free code I found online for creating an overlay that reacts to javascript. It contains a quick time plugin and streams video when the user clicks a link. This is the code exactly as I received it and functions great.
Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head> <style> #displaybox { z-index: 10000; filter: alpha(opacity=50); /*older IE*/ filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50); /* IE */ -moz-opacity: .50; /*older Mozilla*/ -khtml-opacity: 0.5; /*older Safari*/ opacity: 0.5; /*supported by current Mozilla, Safari, and Opera*/ background-color:#000000; position:fixed; top:0px; left:0px; width:100%; height:100%; color:#FFFFFF; text-align:center; vertical-align:middle; } </style> <script> function clicker(){ var thediv=document.getElementById('displaybox'); if(thediv.style.display == "none"){ thediv.style.display = ""; thediv.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><object classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' codebase='http://www.apple.com/qtactivex/qtplugin.cab' width='640' height='500'><param name='src' value='http://cowcast.creativecow.net/after_effects/episodes/Shape_Tips_1_POD.mp4'><param name='bgcolor' value='#000000'><embed src='http://cowcast.creativecow.net/after_effects/episodes/Shape_Tips_1_POD.mp4' autoplay='true' pluginspage='http://www.apple.com/quicktime/download/' height='500' width='640' bgcolor='#000000'></embed></object><br><br><a href='#' onclick='return clicker();'>CLOSE WINDOW</a></td></tr></table>"; }else{ thediv.style.display = "none"; thediv.innerHTML = ''; } return false; } </script> </head> <body> <div id="displaybox" style="display: none;"></div> <a href='#' onclick='return clicker();'>Open Window</a> </body> But bugging/stuttering and browser incompatibility has made me want it to be a .swf file instead. So now I have a very basic flash object that plays my movie, splash.swf. Here is the code and it too functions perfectly: Code: <object width="640" height="480" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/ pub/shockwave/cabs/flash/swflash.cab"> <param name="SRC" value="splash.swf"> <embed src="splash.swf" width="640" height="480"></embed> </object> So now I have two independently working bits of code - one which opens the transparent overlay and plays a video using a quicktime object, and another that is simply a flash object to replace that quicktime object. So what I've done is replaced everything in between the [object]..[/object] in the first code with everything in between the [object]..[/object] in the second code, producing the following new code: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head> <style> #displaybox { z-index: 10000; filter: alpha(opacity=50); /*older IE*/ filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50); /* IE */ -moz-opacity: .50; /*older Mozilla*/ -khtml-opacity: 0.5; /*older Safari*/ opacity: 0.5; /*supported by current Mozilla, Safari, and Opera*/ background-color:#000000; position:fixed; top:0px; left:0px; width:100%; height:100%; color:#FFFFFF; text-align:center; vertical-align:middle; } </style> <script> function clicker(){ var thediv=document.getElementById('displaybox'); if(thediv.style.display == "none"){ thediv.style.display = ""; thediv.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><object width="640" height="480" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/ pub/shockwave/cabs/flash/swflash.cab"> <param name="SRC" value="splash.swf"> <embed src="splash.swf" width="640" height="480"></embed> </object><br><br><a href='#' onclick='return clicker();'>CLOSE WINDOW</a></td></tr></table>"; }else{ thediv.style.display = "none"; thediv.innerHTML = ''; } return false; } </script> </head> <body> <div id="displaybox" style="display: none;"></div> <a href='#' onclick='return clicker();'>Open Window</a> </body> But what is this? By replacing the working quicktime object with the working flash object, Dreamweaver produces a syntax error that wasn't there before, and breaks the entire script. Clearly the script is referencing something within the tags that I am replacing, although it's not clear to me what. Similar TutorialsHi, I'm adding a flash games page to my site. My question is - I have a swf file (say for pac-man), how do I put it in the html? Is this even how one goes about putting a flash game on a page? I've also tried this: I've seen a game that I want - then I've just looked at the source info - then copied the part that "is" the game... like say this: Quote: <object classid "clsid87CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="400"> <param name="movie" value="http://www.flashstash.com/media/swf/catch33.swf"> <param name="quality" value="high"> <embed src="http://www.flashstash.com/media/swf/catch33.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" menu="v" type="application/x-shockwave-flash" width="400" height="400"></embed> </object> ...and just pasted that in an html page, to see if it would work and it did. But, when I do that, is it actually just linking from that page and playing on my screen? What's the right way to go? Can anyone help me? Code: Parse error: syntax error, unexpected T_DNUMBER in /home/a6989956/public_html/include/database.php on line 24 Can anyone please tell me whats wrong? Here is line a few lines Code: class MySQLDB { var $connection; //The MySQL database connection var $num_active_users; //Number of active users viewing site var $num_active_guests; //Number of active guests viewing site var $num_members; //Number of signed-up users /* Note: call getNumMembers() to access $num_members! */ /* Class constructor */ function MySQLDB(){ /* Make connection to database */ $this->connection = mysql_connect(hostname, username, ********) or die(mysql_error()); mysql_select_db(database, $this->connection) or die(mysql_error()); /** * Only query database to find out number of members * when getNumMembers() is called for the first time, * until then, default value set. */ $this->num_members = -1; if(TRACK_VISITORS){ /* Calculate number of users at site */ $this->calcNumActiveUsers(); /* Calculate number of guests at site */ $this->calcNumActiveGuests(); } } line 24-25 is Code: $this->connection = mysql_connect(hostname, username, ********) or die(mysql_error()); mysql_select_db(database, $this->connection) or die(mysql_error()); PLEASE HELP! I've a Syntax error with the following code, any helpwould be grateful <div class="menuBar c2"><a class="menuButton" href="" onclick="return buttonClick(event, 'lifesavingmenu');" onmouseover="buttonMouseover(event, 'lifesavingmenu');">Lifesaving<\/a> <a class="menuButton" href="" onclick="return buttonClick(event, 'mnoticesmenu');" onmouseover="buttonMouseover(event, 'mnoticesmenu');">"M" Notices<\/a> <a class="menuButton" href="" onclick="return buttonClick(event, 'stabilitymenu');" onmouseover="buttonMouseover(event, 'stabilitymenu');">Stability<\/a> <a class="menuButton" href="" onclick="return buttonClick(event, 'radarmenu');" onmouseover="buttonMouseover(event, 'radarMenu');">Radar<\/a> <a class="menuButton" href="" onclick="return buttonClick(event, 'merchantnavymenu');" onmouseover="buttonMouseover(event, 'merchantnavymenu');">Merchant Navy<\/a> <a class="menuButton" href="" onclick="return buttonClick(event, 'alterationsmenu');" onmouseover="buttonMouseover(event, 'alterationsmenu');">Alterations<\/a> <a class="menuButton" href="" onclick="return buttonClick(event, 'lightrecognitionmenu');" onmouseover="buttonMouseover(event, 'lightrecognitionmenu');">Light Recognition<\/a> <a class="menuButton" href="" onclick="return buttonClick(event, 'checklistsmenu');" onmouseover="buttonMouseover(event, 'checklistsmenu');">Checklists<\/a> <a class="menuButton" href="" onclick="return buttonClick(event, 'chartworkmenu');" onmouseover="buttonMouseover(event, 'chartworkmenu');">Chartwork<\/a> <a class="menuButton" href="" onclick="return buttonClick(event, 'situationsmenu');" onmouseover="buttonMouseover(event, 'situationsmenu');">Situations<\/a> <a class="menuButton" href="" onclick="return buttonClick(event, 'photogallerymenu');" onmouseover="buttonMouseover(event, 'alterationsmenu');">Photo Gallery<\/a><\/div> I recently came accross this code with an error on the line itself: function removeWaterMark(e) { var h1s = document.getElementById("window","table","display","notebook","cable","keyboard","iphone","trackball ","tablet", "tc","iphone","postit","remote","speakers","keyboard","cds","printer","foto","papers","cafe","bin"," plant","carpet","chair","sofa","sofa2","wardobe","papers2", "png_carpet","png_cd","png_chair","png_comp","png_cup","png_headphones","png_iphone","png_keyboard", "png_papers","png_passport","png_plant","png_postit","png_regal","png_sheet","png_sheet","png_table" ,"png_tc","png_trackball","png_window")[0].style; if (h1s) { if ((h1s.visibility == "visible") || (h1s.visibility == "")) { h1s.visibility = "hidden"; } else { h1s.visibility = "visible"; } } (e.preventDefault) ? e.preventDefault() : (e.returnValue = false); } Can you tell me what exactly is the problem here? Here is a link to a Screenshot Parse error: syntax error, unexpected T_STRING in /home6/comparea/public_html/search.php on line 340 Partnered up with a buddy to build the website compareacollege.com, he bailed out, unfortunately i know very little about web design, site was fine though, until host made me change password, then the search wouldnt work, the above is the error i was getting, i went into into every page and updated password, actually fixed it about half way through except a little coding was showing up on search page, after i updated every password that error is all that showed up on search, now several months later the page doesnt even show up at all, like its a bad link, not sure what do, hopefully you guys can help me out, hopefully an easy fix Hey guys, I am brand new to HTML. I managed to make it so that when I hover a mouse over an image it will change, like for a menu link button. Its a great effect. I got to thinking about it, and heres something I would LOVE to do: Have a menu link button, at the top of the page, when the mouse scrolls over it another picture changes below it as well as the button changing. So, I would have 4 pics all together. Menu1.jpg (default) Menu2.jpg (when the mouse is over it) Picture1.jpg (default, is a seperate picture below menu1.jpg) and Picture2.jpg (changes from picture1.jpg when the mouse is over menu1.jpg!) I can't seem to pull that off tho... Heres what I kinda attempted to do... <img src="forum2.jpg" style="border: none" name="forum2" <a href="URL"> <img src="forum1.jpg" style= "border: none" name="forum" onmouseover="forum.src='forum2.jpg'" onmouseover="forum2.src='forum1.jpg'" onmouseout="forum.src='forum1.jpg'"/> </a> Hi. I need to do a roll over image swap. When the user rolls over a button I want an image elsewhere on the page to change to a relevant image. i.e. When the user rolls over the Commercial Button, an image int he center of the screen changes to show an image of a commerial bill board. I'm using Dreamweaver mx 2004. I'm sure I had seen the tutorial in the Dreamweaver help files, but now I cannot find it. Can anybody direct me to where I need to look to get this sorted. Cheers. Leroy Ok, I have a button, which i will call button.jpg I have a picture, which I will call picture.jpg I can make the image of the button change when I hover over it, but I ALSO want picture.jpg to change. The other pics are button2.jpg and picture2.jpg So when I hover over button.jpg it will change to button2.jpg and picture.jpg will change to picture2.jpg Any help? Hi there, I'm currently working on http://www.darkboutique.co.uk/DEMO/index.html (WARNING: It is very pink) and I cannot get the text on the right, Recent posts, categories etc. to go to the left. I think this is a HTML problem. Can anyone offer advice please? Thanks I have this script: HTML Code: <script> function upload() { document.getElementById("filebox").style.visibility='visible'; document.getElementById("namebox").style.visibility='hidden'; document.getElementById("newfile").value='1'; } </script> <form method="post" enctype="multipart/form-data"> <table> <tr><td>Bestand:</td><td colspan="2"> <input type="hidden" id="newfile" name="newfile" value="0" /> <span id="filebox" style="visibility:hidden;"> <input type="file" name="uploadedfile" style="width:300px;" /> </span> <span id="namebox"> <input name="filename" type="input" style="width:300px;" value="<?php echo $row['bestand'] ?>" DISABLED="DISABLED" /> <a href="javascript:upload()">New File</a> </span> </td></tr> ...more form... </table> </form> My problem is now that the ''filebox" and "namebox" are not at the same place. I want that if a use presses 'New File' the "namebox" is hidde and ''filebox" appears at exact the same place as "namebox" was. how to do this? Hi, can anyone help me understand why am i getting this error: Page: http://www.mysite.com Category: 102 - SCRIPT not commented Date: 3/30/09 Severity: 4 Threshold: Message: No comment around script content thanks to all for ur time. [url="http://www.buildit.sitesell.com/lavy.html"]SEO friendly Websites[\URL] HI! I need some help but don't see where the problem is. My ftp always returns a 'failed to login' script. Heres what I have: <form name="LoginPage" action="ftp://username:password@ftp.hello.com/" onSubmit="YY_checkform('document.LoginPage','Username','#q','0','Field \"Username\" is not valid.');tmt_compareField('Username', 'Password','!=','Login%20failed.%0DPlease%20try%20again.');tmt_formAction('LoginPage','ftp://username:password@ftp.hello.com');return document.MM_returnValue" method="get"> <p> <h3>Username</h3> </p> <input type="text" name="Username"> <p> <h3>Password</h3> </p> <input type="text" name="Password"> <br><br> <p> <input type="submit" name="Submit" value="Submit"> </p> <p><h3>If you are having problems logging in, please <a href="mailto:hi@hello.com">contact us</a>. </h3></p> </form> I've double checked to be sure the username and password are correct. Also, when I just type ftp://username:password..etc into my URL it goes straight into the ftp site.. Any help? well im creating a new website layout but its being an ass...or its just me well its like 5am here in the UK now which is probebly the reason for the problem but ah well i need it sorting asap and i cant work it out. my website is http://www.rharris28.com so you can see for yourself. basicly everything apart from the bar at the bottom should be on one line, but it just wont do it. i refuse to use tables as ive broken that habbit and want to stear clear of tables at all costs. so its all div's and css work. my html is HTML Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Mixing Pixels - Internet Services :: Homepage</title> <link rel="stylesheet" type="text/css" href="style.css"> <meta name="verify-v1" content="KY6WP1pcuAyddeAyjc4oFZVeQDE0qbbA1GGcJ2Zgu8Y=" /> </head> <body> <div id="background" align="center"> <div id="container" align="left"> <div id="tb"> <div id="tbbg"></div> <div id="topsep"></div> <div id="tophome"></div> <div id="topsep"></div> <div id="topmap"></div> <div id="topsep"></div> <div id="topcontacts"></div> <div id="topsep"></div> <div id="searchbg"><b>Search:</b></div> </div> <div id="topmenu"> <div id="topmenubg">Home</div> <div id="topmenusep"></div> <div id="topmenubg">News</div> <div id="topmenusep"></div> <div id="topmenubg">Downloads</div> <div id="topmenusep"></div> <div id="topmenubg">Search</div> <div id="topmenusep"></div> <div id="topmenubgend">Services</div> </div> </div> </div> </body> </html> and my CSS is Code: * { margin: 0; padding: 0; } #background { background-color:#01557C; height: 100%; width: 100%; } #container { background-color:#FFFFFF; width: 759px; height:500px; } #tbbg { background-image:url(/images/main01.jpg); width:256px; height:41px; } #tb { float:left; width:759px; } #tophome { background-image:url(images/but_home.gif); width:74px; height:41px; } #topmap { background-image:url(images/but_site_map.gif); width:94px; height:41px; } #topcontacts { background-image:url(images/but_contacts.gif); width:96px; height:41px; } #topsep { background-image:url(images/separator.gif); width:2px; height:41px; } #searchbg { width: 231px; height: 41px; background-image:url(images/fon01.gif); } #topmenu { width:759px; } #topmenubg { background-image:url(images/fon_menu.gif); width:132px; height:42px; float:left; text-align:center; } #topmenubgend { background-image:url(images/fon_menu.gif); width:135px; height:42px; float:left; } #topmenusep { background-image:url(images/e_menu.gif); width:24px; height:42px; float:left; } please help...many thanks I've encounter syntax error "){" along the if statements, please let me know what should i do. ? Having problems with this code: If(defined $data->{articleResponse}->{NOTICE}->{COMMENT}->{LR}->{REJECT_INFO}){ If(defined $data->{articleResponse}->{NOTICE}->{COMMENT}->{LR}->{REJECT_INFO}->{ERROR_REJECT_CODE}){ $rejCTag = $data->{articleResponse}->{NOTICE}->{COMMENT}->{LR}->{REJECT_INFO}->{ERROR_REJECT_CODE}; } If(defined $data->{articleResponse}->{NOTICE}->{COMMENT}->{LR}->{REJECT_INFO}->{REJECT_INFO_DESK}){ $rejDTag = $data->{articleResponse}->{NOTICE}->{COMMENT}->{LR}->{REJECT_INFO}->{REJECT_INFO_DESK}; } } I am trying to insert the same html page http://www.danhead.com/store/dirtfest/index.html into several other pages including a myspace profile. Thanks to the blocking of iframes on MySpace the only solution I have found so far is to embed the html in an object. This is the code I am using now to insert the object: Code: <object type="text/html" data="http://www.danhead.com/store/test/index.html" width="420" height="800"></object> My problem is that the object is visible in Mozilla Firefox but not IE and possibly many other browsers as well, for I only have the two to check. With IE, all that appears is a blank frame the intended size of the object. My ultimate intention is to have both the object visible and the transparent background to show through on all browsers. You can view the code in use he http://www.dirtfest.com http://www.myspace.com/dirtfest Thanks in advance! Hi, I think this should be pretty simple to solve but can't find a resource online anywhere. I've written a photo viewing site using HTML server side includes. It is simply a large (480x360px) photo with an embedded object navigation menu below. The navigation menu has thumbnails of all the photos. It looks fine but the glitch is getting the navigation menu to change the large photo. I'm trying to avoid using JScript as it may be seen by those with basic computers (developing countries) although this is an option. The only resources I've found for this suggest creating a new page for each photo. This seems inefficient but I can't figure out if there's an elegant solution (CGI?) to pass which photo is required to a generic webpage. I'm pretty computer literate (degree in computer science in '99) but haven't programmed since I graduated and things have obviously moved on since then. You can see the page at http://osburn.co.uk/testpage/lebleu.shtml and the source below. Thanks for any help! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href= "css/main.css" name="default" type="text/css"/> <title>Davellos test page - business portal</title> <META Name="KEYWORDS" Content=""> <META Name="DESCRIPTION" Content=""> </head> <body> <br><br /> <table class="davell_photo_standard"> <tbody> <tr><td> </td></tr> <tr align="center"> <td id="vu"><a href="movie.shtml"><img alt="Davell tulip" src="jpg/chalets/brad/large/brad.3.jpg" name='SlideShow' align="center" border="0"></a></td> </tr> <tr> <td><object name="lebleuembed" class="davell_smallphoto_embed" data="lebleu2.shtml"></object></td> </tr> </tbody> </table> </body> </html> I'm fixing a website for work, and I need help. I know that you can find out which browser the user is using, but is there anything else you can find out. Specifically, screen resolution or internet speed? Hi, I am trying to create a 'Add to Basket' button on my site using HTML. I have created the following code whcih you can see in action at www.martinspares.com/shop.html (its about halfway down the page). The trouble is that the Quantity box is lower than the button but i would like them to be level which other. How can I achieve this? I am new to all this and am quite confused so any help is much appreciated. Paul HTML Code: <iframe name="cart1" width="0" height="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe> <form action="http://ww4.aitsafe.com/cf/add.cfm" target="cart1"> <input type="hidden" name="userid" value="66349534" /> <input type="hidden" name="nocart" /> <input type="hidden" name="return" value="www.martinspares.com/basket.html" /> <input type="hidden" name="product" value="Mac 600 Colour Wheel" /> <input type="hidden" name="price" value="26.97" /> <input type="hidden" name="scode" value="123456" /> <input name="units" type="hidden" value="2" /> <input type="text" name="qty" size="1"><input type="image" name="Submit" src="wpimages/Add to Basket.png" alt="Add Item to Shopping Cart" onclick="this.src='wpimages/Added to Basket.png'" /> </form> I try to put 2 Objects (probably the wrong word) in a line. I tried div, float and span. I think i just used them in the wrong Way, so may someone here can help me out? Code: <?if($CHAT_BOX$)?> <div class="boxContent" style="width: 50%;"> <div align="center">$CHAT_BOX$<?endif?> <?if($MYINF_5$)?> <div class="boxContent" style="width: 50%;">$MYINF_5$</div> </div> </div><?endif?> Thats the Code, its always Displayed $CHAT_BOX $MYINF_5$ i want it to be $CHAT_BOX $MYINF_5$ ------------------------------------ My header looks weird. I tried using a table to get it down, but it doesn't want to seem to work the way I want it to. I want my search box and submit to ditchtime.com blocks to be right under each other all on the same line with my other ads. Instead the submit 2 ditchtime block is underneath everything else. Any table I could use to fix this? site http://www.ditchtime.com |