JavaScript - Sum Of Int Not Working
This is not working, any idea ?
Code: function respuestas1() { var radios=document.getElementsByTagName("input"); var values; for (var i=0; i<radios.length; i++) { if (radios[i].type==="radio" && radios[i].checked) { values=radios[i].value; sum = 0; for (var i=0; i<values.length; i++) { sum = sum + Number(values[i]); alert(sum); } } } } Similar TutorialsI hope I have this post in the right place! Any help would be very much appreciated... I have a feature on my website that allows users to choose the website background (using alternate css sheets) and then uses an externally linked javascript file to store the background choice as a cookie so it is consistent throughout the website. This works perfectly locally (i.e. when previewing my website on my computer) but now it is uploaded to my host it doesn't appear to be working. (with the same browser) My javascript is he http://www. b r p - e n v .com/javascript/backgroundchange.js (with no spaces) The website that the javascript file is linked to is http://www. b r p - e n v .com (with no spaces) In the head I have: <script type="text/javascript" src="../javascript/backgroundchange.js"></script> ...then I have: <body onload="set_style_from_cookie()"> ...and for users to choose which background: <form> <input type="image" src="../images/white-background-thumb.jpg" onclick="switch_style('bg1');return false;" name="theme" value="White" id="bg1"> etc... </form> My problem is: The background reverts back to the default when moving to a different page. This would indicate that the background choice is not being saved in cookies. But this works locally! I have tried putting the javascript directly onto each page but I still had the same problem. I hope someone can help, I will be so grateful if I can get this to work. Many thanks indeed! Ok, here's the page as it is right now: http://www.crackin.com/dev/index.php The paganation for the top 3 images is Sweet Pages: http://tutorialzine.com/2010/05/swee...tion-solution/ The content loading below is a page-replace script I got he http://css-tricks.com/dynamic-page-replacing-content/ And I'm also trying to integrate shadowbox (or lightbox, whichever will work) into the lower set of images. I have 2 problems right now I can't figure out, and I'm sure it somehow has to do with the fact I'm trying to mash 3 different JS addons into a single page, I'm still pretty new to this whole JS thing... First problem I'm having is that IE7 and Opera don't like the links in the upper images. Clicking a gallery image does not load the associated page below from those 2 browsers, however IE8 and FF seem to work fine. Second problem is getting shadowbox/lightbox to work on those lower images. I tried a couple different things but main thing I did is make sure the script is actually working by setting the header text to a link with shadowbox attached and that worked. That same link doesn't work when applied to the lower images (loads image in new window). Lightbox does the same thing. Thanks for any help. Hi All, I have two sites using zeroclipboard (hosted at google code) one works only in firefox and barely, the other is not working at all. It does use Flash, but I think the issue is on the js side of things. On both links, clicking the filename below the thumbnail will copy and add the link as an IMG code to a div below. *working* link http://pics.boasbysatyra.com/access/spiders.php This one only works in FF, and the clip area is offset badly. Here is the template for the zc code: Code: <div class="photo" style="float: left; padding: 4px;"> <div class="exif"><a href="[~41~]?dir=[+images_dir+]&file=[+filename+]" rel="shadowbox[exif_[+content_id+]]" title="exif data for [+filename+]" alt="exif data for [+filename+]">EXIF Data</a></div> <a class="thumb" rel="shadowbox[[+content_id+]]" href="[+images_dir+][+filename+]" title="[+title+] | [+description+]"> <img src="[+thumbs_dir+][+filename+]" alt="[+title+]" /> </a> <div class="filecode" id="d_clip_button[+filename+]">[+filename+] <script language="JavaScript"> var clip = new ZeroClipboard.Client(); clip.setText( 'http://pics.boasbysatyra.com[+images_dir+][+filename+]' ); clip.glue( 'd_clip_button[+filename+]' ); clip.addEventListener( 'onComplete', my_complete ); function my_complete( client, text ) { $('.picklist').append('<div class="piclinks">[IMG]' + text + '[/IMG]</div>'); } </script> </div> </div> And the JS for the page: Code: var needRef; //flag for page reload function pEdit(){ needRef = 1; } Shadowbox.init({ handleOversize: "resize", modal: true, initialHeight: 32, initialWidth: 400, overlayOpacity: 0.85, onClose: function(){//check for reload flag and reload if (needRef == 1){window.location.href=window.location.href;} } }); ZeroClipboard.setMoviePath('/js/zc/ZeroClipboard10.swf'); function initMenu() { $('#menu ul').hide(); $('#menu ul:first').show(); $('#menu li a').click(function() { var checkElement = $(this).next(); if ((checkElement.is('ul')) && (checkElement.is(':visible'))) { //return false; } if ((checkElement.is('ul')) && (!checkElement.is(':visible'))) { $('#menu ul:visible').slideUp('normal'); checkElement.slideDown('normal'); return false; } }); } $(document).ready(function() { initMenu(); }); Now on to the totally broken one - it creates the elements required, but gives them a 0x0 area! http://jb.boasbysatyra.com/forum-pic...cs/nature.html Code: div class="photo" style="float: left; margin: 4px;"> <div class="exif"><a href="[~133~]?dir=[+images_dir+]&file=[+filename+]" rel="shadowbox[exif_[+content_id+]]" title="exif data for [+filename+]" alt="exif data for [+filename+]">EXIF Data</a></div> <a class="thumb" rel="shadowbox[[+content_id+]]" href="[+images_dir+][+filename+]" title="[+title+] | [+description+]"> <img src="[+thumbs_dir+][+filename+]" alt="[+title+]" /> </a> <div id="d_clip_container[+filename+]" style="position:relative; width: 120px; height: 0.5em;"> <div class="filecode" id="d_clip_button[+filename+]">[+filename+] <script language="JavaScript"> var clip = new ZeroClipboard.Client(); clip.setText( 'http://jb.boasbysatyra.com[+images_dir+][+filename+]' ); clip.glue( 'd_clip_button[+filename+]','d_clip_container[+filename+]' ); clip.addEventListener( 'onComplete', my_complete ); function my_complete( client, text ) { $('.picklist').append('<div class="piclinks">[IMG]' + text + '[/IMG]</div>'); } </script> </div> </div> </div> On this one I wrapped it as suggested on the zc site, I originally started with the code for the other site - it didn't work, so I went tweaking... Here is the JS: Code: var needRef; //flag for page reload function pEdit(){ needRef = 1; } Shadowbox.init({ handleOversize: "resize", modal: true, initialHeight: 32, initialWidth: 400, overlayOpacity: 0.85, onClose: function(){//check for reload flag and reload if (needRef == 1){needRef = 0; window.location.href=window.location.href;} } }); ZeroClipboard.setMoviePath('/js/zc/ZeroClipboard10.swf'); $(document).ready(function() { $(".dim img").fadeTo("slow", 0.65); $(".dim img").hover(function(){ $(this).fadeTo("slow", 1.0); },function(){ $(this).fadeTo("slow", 0.65); }); $('#mainContent').hide().fadeIn(1200); //When page loads... $(".tab_content").hide(); //Hide all content // $("ul.tabs li:first").addClass("active").show(); //Activate first tab // $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active ID content return false; }); }); (function($) { $(document).ready(function(){ $('.menu1').ptMenu(); $('.menu2').ptMenu({vertical:true}); }); })(jQuery); I have taken a look at this for a few days and tried many things with no luck, any help is appreciated. Thanks! I have a usercontrol which get inputs from the user and show the slideshows. I have added jquery.js and jqfancytransitions.js to the control. when i apply the effects dynamically it is working on local iis but the same coding is not working on iis server. The link for the page is http://www.gloriatech.com/slideshow.aspx . Actually it display the images but no effects are applied. I also checked the js files, it is in right path only.When i checked this page in firebug , it shows the error which is " Sys is undefined". I dont know how to solve it. Can anyone help me? Thanx in advance. hereis the html file and javascripton click of this button a html ***************************** <table class=matcolor id=topnav cellspacing=0 cellpadding=0 width=550 border=0 bgcolor="#FFCCCC"> <tbody> <tr align=middle> <td id=menu1 onMouseOver="this.className='mPrimaryOn';showmenu(this);" onClick="this.document.location.href=''" onMouseOut="this.className='mPrimaryOff';hidemenu(this);" class="mat" height="20"> <div align="center"><font color="#FF0000">Desk Top Publishing </font></div> </td> <td width=1 bgcolor=#ff9900 class="mat"></td> <td id=menu2 onMouseOver="this.className='mPrimaryOn';showmenu(this);" onClick="this.document.location.href=''" onMouseOut="this.className='mPrimaryOff';hidemenu(this);" class="mat" height="20"> <div align="center"><font color="#FF0000">Transcription</font></div> </td> <td width=1 bgcolor=#ff9900 class="mat"></td> <td id=menu3 onMouseOver="this.className='mPrimaryOn';showmenu(this);" onClick="this.document.location.href=''" onMouseOut="this.className='mPrimaryOff';hidemenu(this);" class="mat" height="20"> <div align="center"><font color="#FF0000">Accounts Processing </font></div> </td> </tr> </tbody> </table> ***************************************** <script language=JavaScript> ix = document.getElementById('tblmenu1').getBoundingClientRect(); new ypSlideOutMenu("menu1", "right",ix.left + ix.right ,ix.bottom + 10); </script> **any thing i have to alter to work in firefox please help Script::. Code: <script language="javascript"> function temp(form) { oops = ""; var sum = 0; var fld = (form.level.value); var val = fld.value.replace(/\s/g, "" ); if ( val != "") { var deg = parseFloat(fld.value); if ( isNaN(deg) || deg < 0) { fld.value = "0"; oops += "\nInvalid Level"; } else if ( deg != 0 ) { sum += Math.pow( deg, 3 );} } if ( oops != "" ) { alert("You must correct these errors:\n" + oops); return false; } form.totalexp.value = sum ; } </script> Html::. Code: <form style="text-align:center"> <p>Level</p> <p><input size=30 maxlength=30 value=0 name="level" onfocus="this.value=''"/></p> <input type=button onclick=temp(this.form) value=Calculate /> <input type=reset name=clear id=clear value=Clear /></p> <blockquote><p>Total Exp <input name="totalexp" size=40 maxlength=40 readonly=""/></p></blockquote></form> Can someone help me. Whats wrong with my js code and i am noob to J.S. Your help is most appreciated. hi jus want to ask why is the else not working in the showmore and showless function i have two div which shld conduct the same way of working which is to show the rest of the text with the show more and min the text with the show less function anyone know what my mistake is? Code: function showmore() { if (document.getElementById("mydiv1") ){ document.getElementById("mydiv1").innerHTML = ""; document.getElementById("mydiv1").innerHTML = txt1 + "<font color = '#0000FF' size = '1'><a onclick='showless();return false'>.....read less</a>";txt1; } else { document.getElementById("mydiv").innerHTML = ""; document.getElementById("mydiv").innerHTML = txt + "<font color = '#0000FF' size = '1'><a onclick='showless();return false'>.....read less</a>";txt; } } function showless() { if (document.getElementById("mydiv1")){ document.getElementById("mydiv1").innerHTML = shorttxt1 + "<font color = '#0000FF' size = '1'><a onclick='showmore();return false'>.....read more</a>"; } else { document.getElementById("mydiv").innerHTML = shorttxt + "<font color = '#0000FF' size = '1'><a onclick='showmore();return false'>.....read more</a>"; } } thanks Reply asap!!! In my website, I have a script that I need help to get working. This is my script. Code: <script language="Javascript"> <!-- if (screen.width>=1024) { document.write('<td width="20%"><table border="0" cellpadding="0" cellspacing="0" width="162"> <tr><td height="29" style="background:url("/Custom/Top2.png");color:#116111;" align="center"><b>Newest Tutorial</b></td></tr> <tr><td height="160" style="background:url("/Custom/Middle2.png") #000000;padding:5px 5px 0 5px;">$MYINF_8$</td></tr> <tr><td><img src="/Custom/Bottom2.png" border="0"></td></tr> </table> </td>'); } //--> </script> It is supposed to detect if someone has a widescreen monitor, and then add the extra box if it is widescreen. For some unknown reason, its not working. No extra box appears. Does anyone know where I went wrong? Edit: $MYINF_8$ is what goes inside the box. Won't validate help...pasor error? Wtf i suck at this. Code: <?xml version="1.0" encoding="UTF-8"?> <!--Prolog Above--> <!--dataset is the name of the Root Element--> <!--Artist, Album, and, Publisher are the names of the namespaces, Ar, Al, and, Pu are the prefixes--> <dataset xmlns:Al="Album" xmlns:Ar="Artist" xmlns:Pu="Publisher" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <!--Elements, blank text is data--> <dataset> <Al:Album> <Al:Album ID =""> <Al:Genre =""></Al:Genre> <Al:AmountSold =""></Al:AmountSold> <Al:PublishDate =""></Al:PublishDate> <Al:Artist =""></Al:Artist> </Al:Album> </Al:Album> <Ar:Artist> <Ar:Artist ID =""> <Ar:Awards =""></Ar:Awards> <Ar:Location =""></Ar:Location> <Ar:Region =""></Ar:Region> <Ar:LabelID =""></Ar:LabelID> </Ar:Artist> </Ar:Artist> <Pu:Publisher> <Pu:Publisher ID =""> <Pu:AmountSold =""></Pu:AmountSold> <Pu:Artist = ""></Pu:Artist> <Pu:PublishDate =""></Pu:PublishDate> <Pu:Manager = ""></Pu:Manager> </Pu:Publisher> </Pu:Publisher> </dataset> I am trying to use "&&" like in PHP, but JavaScript doesn't like it: Code: if (document.forms["form"]["30"].value == "" && document.forms["form"]["32"].value == "") {foobar;} So, if both these conditions are true, then foobar. Does anyone know why it doesn't work? Hi guys, For some reason, in IE8, on product pages (Example) of my ecommerce site, the 'Size Chart' and 'Email to a Friend' popups don't work, and the product image lightbox won't work either. I have turned pop-up blocker off but they still don't work. These popups work in every other browser I have tested in, including IE7. It seems to only be IE8 that is having this problem. Here is the HTML: Code: <div class="row "> <label >Size: </label> <strong class="fl"><select name="size" id="size" onchange="checkstock(this.value)"><option value="">Select Size</option><option value="S">S</option><option value="M">M</option><option value="L">L</option><option value="XL">XL</option><option value="XXL">XXL</option></select></strong> <span style="text-decoration: underline;" class="size_chart more" title="size_chart1">+ Size Chart</span> <div style="display: none;" class="size_chart1 hide" > <div class="close"></div> <img src="http://www.projectdisobey.com/disobeyclothing/wp-content/themes/eCommerce3/images/size_chart.jpg" alt="" /> </div> <!-- size chart --> </div> Code: <ul class="fav_link"> <li class="print"> <a href="#" onclick="window.print();return false;">Print</a> </li> <li class="rss"> <a href="http://feeds.feedburner.com/DisobeyClothing">RSS</a> </li> <li class="emailtofriend"> <span style="text-decoration: underline;" class="more" title="tellafrnd_div">Email to a Friend</span> <span id="tellafrnd_success_msg_span"></span> <div style="display: none;" id="tellfrnddiv" class="tellafrnd_div hide"> <iframe src="http://www.projectdisobey.com/disobeyclothing/?page=tellafriend_form&pid=402" style="border: medium none ; width: 547px; height: 558px;" frameborder="0" ></iframe> </div> </li> <li class="share"> <div class="a2a_kit addtoany_list"> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.projectdisobey.com/disobeyclothing/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/> </a> </div> <script type="text/javascript"><!-- var a2a_config = a2a_config || {}; a2a_config.linkname="Know Your Enemy"; a2a_config.linkurl="http://www.projectdisobey.com/disobeyclothing/?p=402"; a2a_config.color_main = "f3f3e7";a2a_config.color_border = "C0C88A";a2a_config.color_link_text = "332402";a2a_config.color_link_text_hover = "332402";a2a_config.color_bg = "7f6f2"; a2a_config.num_services = 14; //--></script><script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script> </li> </ul> Here is the Javascript: Code: <script type="text/javascript"> var closebutton='<?php bloginfo('template_directory'); ?>/library/js/closebox.png'; </script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/library/js/fancyzoom.js"></script> <script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('div.photo a').fancyZoom({scaleImg: true, closeOnClick: true}); $('#medium_box_link').fancyZoom({width:400, height:300}); $('#large_box_link').fancyZoom(); $('#flash_box_link').fancyZoom(); }); </script> <script type="text/javascript"> /* <![CDATA[ */ $(document).ready(function(){ $('.hide').hide(); $('body').append('<div id="infoBacking"></div><div id="infoHolder" class="large"></div>'); $('#infoBacking').css({position:'absolute', left:0, top:0, display:'none', textAlign:'center', background:'', zIndex:'600'}); $('#infoHolder').css({left:0, top:0, display:'none', textAlign:'center', zIndex:'600', position:'fixed'}); if($.browser.msie){$('#infoHolder').css({position:'absolute'});} $('.more').mouseover(function() {$(this).css({textDecoration:'none'});} ); $('.more').mouseout(function() {$(this).css({textDecoration:'none'});} ); $('.more').click(function(){ if ($('.' + $(this).attr("title")).length > 0) { browserWindow() getScrollXY() if (height<totalY) { height=totalY; } $('#infoBacking').css({width: totalX + 'px', height: height + 'px', top:'0px', left:scrOfX + 'px', opacity:0.85}); $('#infoHolder').css({width: width + 'px', top:scrOfY + 25 + 'px', left:scrOfX + 'px'}); source = $(this).attr("title"); $('#infoHolder').html('<div id="info">' + $('.' + source).html() + '<p class="clear"><span class="close"><?php _e('Close X');?></span></p></div>'); $('#infoBacking').css({display:'block'}); $('#infoHolder').show(); $('#info').fadeIn('slow'); } $('.close').click(function(){ $('#infoBacking').hide(); $('#infoHolder').fadeOut('fast'); }); }); /* find browser window size */ function browserWindow () { width = 0 height = 0; if (document.documentElement) { width = document.documentElement.offsetWidth; height = document.documentElement.offsetHeight; } else if (window.innerWidth && window.innerHeight) { width = window.innerWidth; height = window.innerHeight; } return [width, height]; } /* find total page height */ function getScrollXY() { scrOfX = 0; scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } totalY = (window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null ? document.body.clientHeight : null); totalX = (window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null); return [ scrOfX, scrOfY, totalY, totalX ]; } return false; }); /* ]]> */ </script> Anybody have any suggestions as to what the problem might be (and how I can rectify it)? If you need more info, please let me know... Thanks! I think that if there is more space between the columns that it would be easier to read, but whatever I try is not working. Just putting tabs between them is my latest idea, however, the space is not all that big. Is it possible that I have entered it wrong? Thank you, the code is below: <html> <head> <title>Exercise</title> <script type = "text/javascript"> <!-- var row = 0; var cols = 0; var sum = (row + 1); if (row ==0) { document.write("sum   square   cube"); document.write("<br>"); row++; } while((row >= 0) && (row <= 11)) { document.write(row + "\t" + (row * row) + "\t" + (row * row * row)); document.write("<br>"); row++; } // --> </script> </head> <body> <p>what? seriously, this is working?</p> </body> </html> Can you please take a look at this and tell me why it is not getting all the way thru the function and why this is not working totally. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <script type="text/javascript"> function cabFair(start, end, time){ var base = 0; if (start = 1){ if (end = 1){ base = 5; }if (end = 2) { base = 7; }base = 8; }if (start = 2){ if (end = 1){ base = 7; }if (end = 2) { base = 5; }base = 9; }if (end = 1){ base = 8; }if (end = 2) { base = 9; }base = 5; //return(base); if (time > 20){ time1 = (time - 20); time2 = (time1 * (.3)); finalTime = (time2 + 10); }if (time > 10 && time <= 20){ time1 = (time - 10); time2 = (time1 * (.4)); finalTime = (time2 + 6); }if (time >4 && time <= 10){ time1 = (time - 4); time2 = (time1 * (.5)); finalTime = (time2 + 3); }finalTime = (time * .75); var fare = finalTime + base; return fare } </script> </head> <body> <script type="text/javascript"> //Ask user for input var start = parseInt(prompt("Enter the Starting Point", "1")); var end = parseInt(prompt("Enter the Ending Point", "2")); var time = parseInt(prompt("Enter the Total Time", "4")); //output for information document.writeln(cabFair(start, end, time) + " Is the Total Fare."); </script> </body> </html> check out this page http://qa-www.inmarkit.net/cu.php (you might see an ERROR like "Notice: Undefined index: SCRIPT_URI ... on line 23" THAT'S FINE - that page sets a cookie to allow you to see the header with login on homepage) then go to the homepage: http://qa-www.inmarkit.net/ and try to click on "Log In" in top right corner a overlay with iFrame opens IE7 but not in IE8 can anyone point me in the right direction... what's the right way to handle something like this? approach? steps? techniques? tools? Thank you... PS Looking for general advise - but perhaps you are up to the challenge and see the exact cause? HI, i know this must be old js because 'language' is deprecated but, I would like to know where this script gets the word 'Name:' from for the output after I entered dat to the textbox. Code: <HTML> <HEAD> <script language="javascript"> <!-- function send_onclick(frmName) { var bolSubmit; bolSubmit = true; if (frmName.email.value == "") { alert("You must enter an email address"); bolSubmit = false; } if (bolSubmit == true) { frmName.submit(frmName); } } //--> </script> </HEAD> <BODY> <form name="frmName" method="post" action="validate.asp"> Enter your name in the text box. If nothing is entered, a warning message will be displayed. <br>Only when you enter something into the text box will the page be submitted. <br><br> Please enter your name : <INPUT TYPE="TEXT" name="email" size="20"><br> <INPUT TYPE="button" name="butSent" value="Do it" language="javascript" onclick="return send_onclick(frmName)"> </form> Name : d </BODY> </HTML> I guess its from the 'name' of name='email' but how does it do it. Is this next part grabbing everything that was submitted as if a key/value pair? Code: if (bolSubmit == true) { frmName.submit(frmName); } bazz I am trying to toggle a button (button-top) to move 860px to the right when clicked, while a div panel (textbox1) with text slides down next to it. The panel toggles fine when the buttons (wrap or button-top) are clicked, but the button moves to the right, and then does not move back to its original position when the buttons are clicked the second time. I have tried so many different methods of coding this, but i have problems where the button keeps moving further to the right every time it is clicked. or when it does move back, it does it automatically (not on click) and suddenly disappears. Here is the code that I have ended up with so far. Code: $(function() { $("#textbox1").hide(); $("#wrap").click(function() { $("#button-top").animate({right: "860px"}, 2000); $('#textbox1').animate({height: "toggle"}, 2000); }); }); I write javascript for image slide show. Code: var mygallery=new fadeSlideShow({ wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow dimensions: [380, 469], //width/height of gallery in pixels. Should reflect dimensions of largest image imagearray: [ <?php $q2 = mysql_query("select * from home_flash"); $i = 0; while($res = mysql_fetch_array($q2)) { $image[$i] = $res[1]; $text[$i] = $res[2]; $str = "['images/fla/".$image[$i]."','','','".$text[$i]."'],"; echo $str; $i++; } ?> //<--no trailing comma after very last image element! ], displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false}, persist: false, //remember last viewed slide and recall within same session? fadeduration: 500, //transition duration (milliseconds) descreveal: "always", togglerid: "" }) In IE I got an error Quote: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.2) Timestamp: Sat, 20 Mar 2010 06:22:10 UTC Message: 'imagearray[...].0' is null or not an object Line: 37 Char: 3 Code: 0 If you have solution for thi, then please help with it! Thanks for your precious time. Cheers!! Hey all, great forum! I am wanting to change the CSS properties for a webapp.. The default instance is when the webapp is launched from a safari browser. The part I have trouble with, is defining how to show different CSS when the webapp is launched from the homescreen of a mobile device. Here is the code I am trying, but have no luck: Quote: <script type="text/javascript"> if (window.navigator.standalone == true) { //alert('homescreen'); $('body > #footer').css({bottom: '0px !important'}); $('body > #wrapper').css({bottom: '0px !important'}); } </script> I've got an annoying non-working bit of code: Code: <div id ="messageDiv" style="display:block;">No profile information entered yet</div> <script type="text/javascript"> function profileInfo() { var m1 = document.getElementById("marital1").innerHTML.toLowerCase(); var b1 = document.getElementById("bodytype1").innerHTML.toLowerCase(); var e1 = document.getElementById("ethnic1").innerHTML.toLowerCase(); var o1 = document.getElementById("occupation1").innerHTML; var w1 = document.getElementById("website1").innerHTML.toLowerCase(); var s1 = document.getElementById("smoker1").innerHTML.toLowerCase(); var d1 = document.getElementById("drinker1").innerHTML.toLowerCase(); var r1 = document.getElementById("religion1").innerHTML.toLowerCase(); if ((m1 == "no answer") && (b1 == "no answer") && (e1 == "no answer") && (o1 == "") && (w1 == '<a href=""></a>') && (s1 == "no answer") && (d1 == "no answer") && (r1 == "no answer")){ document.getElementById("messageDiv").style.display="block"; } else if ((m1 == "no answer") && (b1 == "no answer") && (e1 == "no answer") && (o1 == "") && (w1 == '<a href="http://">http://</a>') && (s1 == "no answer") && (d1 == "no answer") && (r1 == "no answer")){ document.getElementById("messageDiv").style.display="block"; } else { document.getElementById("messageDiv").style.display="none"; } } profileInfo() </script> The first part up to before the 'else if' works. but if the 'w1' has '<a href="http://">http://</a>' it still doesnt return true and display the DIV block?? |