JavaScript - Need Help With Script With Window.open, Script Works In Seamonkey But Not In Ie 8
I have a script that works in seamonkey(my html editor) but when I use it in IE8 it says errors happen.
Here's the code (the first line is on line 7 of the html file): Code: <script type="text/javascript"> function enlarge(imageNum) { var numToString = ""; if(parseInt(imageNum) < 10){ numToString = "0" + imageNum; } else { numToString = imageNum + ""; } window.open("images/LgScreenshot"+numToString+".jpg","Screenshot "+imageNum,"status=0,height=675,width=900,resizable=0"); } </script> And the errors: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB0.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; InfoPath.3; .NET CLR 3.0.30729) Timestamp: Wed, 10 Feb 2010 14:58:16 UTC Message: Object expected Line: 150 Char: 1 Code: 0 URI: http://samssc2site.co.cc/Features.html Message: Invalid argument. Line: 18 Char: 1 Code: 0 URI: http://samssc2site.co.cc/Features.html Similar TutorialsHi! everyone. I've run into a problem with a piece of script and being code illiterate I could use some help. I'm making a page with a few thumbnails that I want to use as links to open a larger image in a pop-up window. I found this piece of code ( call it a senior moment ~ but I didn't make a note of where it was ) that works fine in Firefox and Safari, but IE8 is telling me that there is an error in the highlighted line: Code: <script language="JavaScript"> function openW(mypage,myname,w,h,features) { if(screen.width){ var winl = (screen.width-w)/2; var wint = (screen.height-h)/2; }else{winl = 0;wint =0;} if (winl < 0) winl = 0; if (wint < 0) wint = 0; var settings = 'height=' + h + ','; settings += 'width=' + w + ','; settings += 'top=' + wint + ','; settings += 'left=' + winl + ','; settings += features; win = window.open(mypage,myname,settings); win.window.focus(); } </script> Code: <a href="JavaScript:openW('URL','TITLE',WIDTH,HEIGHT,'')">LINK</a> Anyone got an idea if it can be tweaked to make IE recognize it? Or a simple alternative script that works cross browser? Any help would be greatly appreciated. Thanks Hi guys i want to make my javascript open the link in the same window instead of opening up i new tab, i know this should be basic but for some reason i can't figure it out, ill post the code below, thanks Code: for (var i=0; i <UN.length; i ++) { if (( UN[i].toLowerCase() == uname.toLowerCase() ) && (PW[i] == pword)) { alert ("User name and password matched!"); valid = true; window.open('http://www.google.com'); How can i run a script after the window.open loads completely?
Hello all,I have a website and I would like a pop-up window to promote a new website venture I have. I would like for the new website to open in a completely new window/browser when my members simply click on the index page (No link or Buttons).The code below does most of what I ask lol,but it.. 1.Only opens in a new tab (in same browser) while I would like for it to open in a completely new browser "full page" menu bar scroll tab and all. plus 2.It seems to open each and every time the page is clicked,which will be annoying to my members.I would only like for it to open 1 time per visitor every 24 hours or whenever cookies are cleared. Code: <html> <head> <script type="text/javascript"> function click_on() { window.open("URL HERE", "_blank"); } </script> </head> <body onclick="click_on()"> </body> </html> I am no expert at this,and my knowledge is very limited,so excuse me if this is a simple situation.Any help would be greatly appreciated. Thanks, Roco Hi friends, Im using javascript for my gallery with slideshow, its perfectly working in 3 browsers like safari, Firefox and chrome but not working in IE7. There is an alignment problem + scripting problem, Pls help me friends asap. Thanks. I just discovered one of my scripts doesn't work quite right on an older version of Firefox(3.622). It does when I reload the page, but not automatically on initial load Any thoughts on what to change? Here's what I have... Code: <script type="text/javascript" src="author_find.js"></script> <img src=/storage/image.gif onload="javascript:doit();" /> <div id="author"></div> Here is the script it is referencing: Code: function doit() { if($('div').hasClass('single-journal-entry-wrapper')) { var theURL = null; var spans = document.getElementsByTagName("span"); for ( var s = 0; s < spans.length; s++ ) { // searching through spans for the class name: var span = spans[s]; if ( span.className.indexOf("posted-by") >= 0 ) { var useit = span.getElementsByTagName("a")[0]; theURL = useit.href; break; // just the one } } if ( theURL == null ) { // alert("failed!"); } else { var parts = theURL.split('/'); var result = parts[parts.length-1]; if (result == "somebodysname") { var txt=document.getElementById("author"); txt.innerHTML="<table width=100px border=0 cellpadding=0 cellspacing=0 bgcolor=#ffffff><tr><td>content1</td></tr></table>"; } else if (result == "anothername") { var txt=document.getElementById("author"); txt.innerHTML="content2"; } } }else { } } Hi, I'm a JS newbie, but I came up with a (doubtless flawed) script to swap out flash videos according to the selection from an html form. The script works in IE, and used to work for me in FF3, but no longer works for me in FF3.5.2. The code is as follows: Code: <html> <head> <script type="text/javascript"> function changeEp() { var chosen = prepisodes.value; var swapStr = '<embed src="http://c.brightcove.com/services/viewer/federated_f8/1119352258"\n' + 'bgcolor="#FFFFFF"\n' + 'flashVars="videoId=' + chosen + '&playerId=1119352258&viewerSecureGatewayURL=https://console.brightcove.com/services/amfgateway&servicesURL=http://services.brightcove.com/services&cdnURL=http://admin.brightcove.com&domain=embed&autoStart=false&"\n' + 'base="http://admin.brightcove.com" name="flashObj"\n' + 'width="100%" height="509" seamlesstabbing="false" type="application/x-shockwave-flash" swLiveConnect="true"\n' + 'pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>'; document.getElementById('swapDiv').innerHTML = swapStr; } </script> </head> <body> <div id="swapDiv"> <embed src="http://c.brightcove.com/services/viewer/federated_f8/1119352258" bgcolor="#FFFFFF" flashVars="videoId=6069547001&playerId=1119352258&viewerSecureGatewayURL=https://console.brightcove.com/services/amfgateway&servicesURL=http://services.brightcove.com/services&cdnURL=http://admin.brightcove.com&domain=embed&autoStart=false&" base="http://admin.brightcove.com" name="flashObj" width="100%" height="509" seamlesstabbing="false" type="application/x-shockwave-flash" swLiveConnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed> </div> <div> <select name="prepisodes" id="prepisodes" style="background:white;border:red;width:100%;color:red;font-size:100%;font-family:constantia;" onChange="changeEp();"> <option value="6069547001" style="background:gold;">episode 1: arrival</option> <option value="6081338001">episode 2: the chimes of big ben</option> <option value="6081339001" style="background:gold;">episode 3: a b and c</option> <option value="6081340001">episode 4: free for all</option> <option value="6081341001" style="background:gold;">episode 5: the schizoid man</option> <option value="6081342001">episode 6: the general</option> <option value="6081343001" style="background:gold;">episode 7: many happy returns</option> <option value="6081344001">episode 8: dance of the dead</option> <option value="6081346001" style="background:gold;">episode 9: checkmate</option> <option value="6081349001">episode 10: hammer into anvil</option> <option value="6081345001" style="background:gold;">episode 11: it's your funeral</option> <option value="6081348001">episode 12: a change of mind</option> <option value="6081359001" style="background:gold;">episode 13: do not forsake me oh my darling</option> <option value="6081347001">episode 14: living in harmony</option> <option value="6081350001" style="background:gold;">episode 15: the girl who was death</option> <option value="6081351001">episode 16: once upon a time</option> <option value="6081352001" style="background:gold;">episode 17: fall out</option> </select> </div> </body> </html> I used the name attribute, as it allowed the script to work in IE, and the id attribute, as it allowed the script to work in FF (at least before I upgraded). Any assistance with this would be much appreciated. Hey, I'm trying to write a script that makes it so that when using a screen width of 1280 or lower, Google shows one ad at the top of the page. With screen widths over 1280, it shows 2 ads along the side of the screen. I've checked it several times and I don't know what I've done wrong (but I'm also a beginner). The script works flawlessly in all versions of Firefox for both high and low res (I checked with FF 2.0, 3.0, 3.5, and 3.6) but in IE6 and IE8 while displaying almost correctly at the high resolution, it gets completely screwed up at the low resolution. Basically I'm just using Javascript to insert HTML comment tags around the ads that I don't want to appear for that resolution. Apparently it doesn't work in Opera, Chrome, or Safari either and the code doesn't validate as XHTML so there is definitely something wrong. Code: <!-- Test run of Google AdSense --> <!-- One ad floats left, one floats right, the rest of the body is center aligned in between (high res only) --> <!-- There are 3 ads, scripting makes it so that 2 appear on the sides with a screen width above 1280 pixels, and below 1280 pixels just one appears across the top --> <script type="text/javascript"> <!-- var skip1 = "<!--"; if ( screen.width <= 1280 ) { document.write (skip1); } //--> </script> <div style=" float:left; font-size:7pt; color:#777; "> Advertisement<br /> <script type="text/javascript"><!-- google_ad_client = "pub-9736870014804453"; /* 160x600, created 2/2/11, left side homepage */ google_ad_slot = "6021069285"; google_ad_width = 160; google_ad_height = 600; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> <div style=" float:right; font-size:7pt; color:#777; "> Advertisement<br /> <script type="text/javascript"><!-- google_ad_client = "pub-9736870014804453"; /* 160x600, created 2/2/11, homepage */ google_ad_slot = "3502793671"; google_ad_width = 160; google_ad_height = 600; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> <script type="text/javascript"> <!-- var skip2 = "-->"; if ( screen.width <= 1280 ) { document.write (skip2); } //--> </script> <script type="text/javascript"> <!-- var skip3 = "<!--"; if ( screen.width > 1280 ) { document.write (skip3); } //--> </script> <div style="font-size:7pt; color:#777;"> <center> Advertisement<br /><br /> <script type="text/javascript"><!-- google_ad_client = "pub-9736870014804453"; /* low res top ad */ google_ad_slot = "4610054252"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </center> </div> <script type="text/javascript"> <!-- var skip4 = "-->"; if ( screen.width > 1280 ) { document.write (skip4); } //--> </script> <!-- End of Adsense side banners --> Hi, I've been trying to solve this problem for the past few hours and I'm at my wit's end. I have a script that runs through all the div elements on the page, and then if the div's background is a certain color, it increments a counter by 0.5 and then outputs the result into a separate div tag. This works flawlessly in IE, however I cannot get it to work in Firefox. The strange thing is, if I omit the loop and just use the colorToHex on one specific element in the divs array (ie. divs[2]) it works in Firefox. Any suggestions are greatly appreciated. Code: function hrsavailable() { var divs = document.getElementsByTagName("div"); var srdjanhrs = -0.5; for (var i=0;i<divs.length;i++){ if (colorToHex(divs[i].style.backgroundColor) == "#ffbb6e") {; srdjanhrs = srdjanhrs + 0.5; } } document.getElementById("srdjanhrs").firstChild.data = srdjanhrs; } function colorToHex(color) { if (color.substr(0, 1) === '#') { return color; } var digits = /(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec(color); var red = parseInt(digits[2]); var green = parseInt(digits[3]); var blue = parseInt(digits[4]); var rgb = blue | (green << 8) | (red << 16); return digits[1] + '#' + rgb.toString(16); } So, I am working out a current issue I'm having with a sortable table script. Code: var sortableTable = new Class({:thumbsup: getOptions: function(){ return { overCls: false, onClick: true, sortOn: 0, sortBy: 'ASC', filterHide: true, filterHideCls: 'hide', filterSelectedCls: 'selected' }; }, initialize: function(table, options){ this.setOptions(this.getOptions(), options); this.table = $(table); this.tHead = this.table.getElement('thead'); this.tBody = this.table.getElement('tbody'); this.tFoot = this.table.getElement('tfoot'); this.elements = this.tBody.getElements('tr'); this.filtered = false; /*for(i=0;i<10;i++){ this.elements.clone().injectInside(this.tBody); } this.elements = this.tBody.getElements('tr');*/ //THIS IS FOR ANIMATION AND POINTER EFFECT ON HOVER this.elements.each(function(el,i){ if(this.options.overCls){ el.addEvent('mouseover', function(){ el.addClass(options.overCls); }, this); el.addEvent('mouseout', function(){ el.removeClass(options.overCls); }); } if(this.options.onClick){ el.addEvent('click', options.onClick); } }, this); //setup header this.tHead.getElements('th').each(function(el,i){ if(el.axis){ el.addEvent('click', this.sort.bind(this,i)); el.addEvent('mouseover', function(){ el.addClass('tableHeaderOver'); }); el.addEvent('mouseout', function(){ el.removeClass('tableHeaderOver'); }); el.getdate = function(str){ // inner util function to convert 2-digit years to 4 function fixYear(yr) { yr = +yr; if (yr<50) { yr += 2000; } else if (yr<100) { yr += 1900; } return yr; }; var ret; // if (str.length>12){ strtime = str.substring(str.lastIndexOf(' ')+1); strtime = strtime.substring(0,2)+strtime.substr(-2) }else{ strtime = '0000'; } // // YYYY-MM-DD if (ret=str.match(/(\d{2,4})-(\d{1,2})-(\d{1,2})/)) { return (fixYear(ret[1])*10000) + (ret[2]*100) + (+ret[3]) + strtime; } // DD/MM/YY[YY] or DD-MM-YY[YY] if (ret=str.match(/(\d{1,2})[\/-](\d{1,2})[\/-](\d{2,4})/)) { return (fixYear(ret[3])*10000) + (ret[2]*100) + (+ret[1]) + strtime; } return 999999990000; // So non-parsed dates will be last, not first }; // el.findData = function(elem){ var child = elem.getFirst(); if(child){ return el.findData(child); }else{ return elem.innerHTML.trim(); } }; // el.compare = function(a,b){ var1 = el.findData(a.getChildren()[i]); var2 = el.findData(b.getChildren()[i]); //var1 = a.getChildren()[i].firstChild.data; //var2 = b.getChildren()[i].firstChild.data; if(el.axis == 'number'){ var1 = parseFloat(var1); var2 = parseFloat(var2); if(el.sortBy == 'ASC'){ return var1-var2; }else{ return var2-var1; } }else if(el.axis == 'string'){ var1 = var1.toUpperCase(); var2 = var2.toUpperCase(); if(var1==var2){return 0}; if(el.sortBy == 'ASC'){ if(var1<var2){return -1}; }else{ if(var1>var2){return -1}; } return 1; }else if(el.axis == 'date'){ var1 = parseFloat(el.getdate(var1)); var2 = parseFloat(el.getdate(var2)); if(el.sortBy == 'ASC'){ return var1-var2; }else{ return var2-var1; } }else if(el.axis == 'currency'){ var1 = parseFloat(var1.substr(1).replace(',','')); var2 = parseFloat(var2.substr(1).replace(',','')); if(el.sortBy == 'ASC'){ return var1-var2; }else{ return var2-var1; } } } if(i == this.options.sortOn){ el.fireEvent('click'); } } }, this); }, sort: function(index){ if(this.options.onStart){ this.fireEvent('onStart'); } // this.options.sortOn = index; var header = this.tHead.getElements('th'); var el = header[index]; header.each(function(e,i){ if(i != index){ e.removeClass('sortedASC'); e.removeClass('sortedDESC'); } }); if(el.hasClass('sortedASC')){ el.removeClass('sortedASC'); el.addClass('sortedDESC'); el.sortBy = 'DESC'; }else if(el.hasClass('sortedDESC')){ el.removeClass('sortedDESC'); el.addClass('sortedASC'); el.sortBy = 'ASC'; }else{ if(this.options.sortBy == 'ASC'){ el.addClass('sortedASC'); el.sortBy = 'ASC'; }else if(this.options.sortBy == 'DESC'){ el.addClass('sortedDESC'); el.sortBy = 'DESC'; } } // this.elements.sort(el.compare); this.elements.injectInside(this.tBody); // if(this.filtered){ this.filteredAltRow(); }else{ this.altRow(); } // if(this.options.onComplete){ this.fireEvent('onComplete'); } }, altRow: function(){ this.elements.each(function(el,i){ if(i % 2){ el.removeClass('altRow'); }else{ el.addClass('altRow'); } }); }, filteredAltRow: function(){ this.table.getElements('.'+this.options.filterSelectedCls).each(function(el,i){ if(i % 2){ el.removeClass('altRow'); }else{ el.addClass('altRow'); } }); }, filter: function(form){ var form = $(form); var col = 0; var key = ''; form.getChildren().each(function(el,i){ if(el.id == 'column'){ col = Number(el.value); } if(el.id == 'keyword'){ key = el.value.toLowerCase(); } if(el.type == 'reset'){ el.addEvent('click',this.clearFilter.bind(this)); } }, this); if(key){ this.elements.each(function(el,i){ if(this.options.filterHide){ el.removeClass('altRow'); } if(el.getChildren()[col].firstChild.data.toLowerCase().indexOf(key) > -1){ el.addClass(this.options.filterSelectedCls); if(this.options.filterHide){ el.removeClass(this.options.filterHideCls); } }else{ el.removeClass(this.options.filterSelectedCls); if(this.options.filterHide){ el.addClass(this.options.filterHideCls); } } }, this); if(this.options.filterHide){ this.filteredAltRow(); this.filtered = true; } } }, clearFilter: function(){ this.elements.each(function(el,i){ el.removeClass(this.options.filterSelectedCls); if(this.options.filterHide){ el.removeClass(this.options.filterHideCls); } }, this); if(this.options.filterHide){ this.altRow(); this.filtered = false; } } }); sortableTable.implement(new Events); sortableTable.implement(new Options); It works flawlessly on my dev page: http://www.align.com/Dev/Resources/ But I am having issues with is on my live page: http://www.align.com/Resources/ My first thought is that it could be a labeling issue (ie: I forgot to remove "/dev" when moving the HTML over to live) but after reviewing for an hour, I don't believe this is the issue. Could it be an ASP issue? thx in advance.... -Mike Fortuna This script is supposed to tally the score of the questions. It shows up fine but it does not tally the score <p>You are on a business journey beyond traditional small business style <input type="checkbox" value="1" name="Q1">yes <input type="checkbox" value="0" name="Q1">no</p> <p>You don t want to be the glue holding everyday operations together <input type="checkbox" value="1" name="Q1">yes <input type="checkbox" value="0" name="Q1">no</p> <p>You are comfortable with using simple business technology tools and the web <input type="checkbox" value="1" name="Q1">yes <input type="checkbox" value="0" name="Q1">no</p> <p>You believe in business operations based upon processes <input type="checkbox" value="1" name="Q1">yes <input type="checkbox" value="0" name="Q1">no</p> <p>You earn operating success by having a good working team <input type="checkbox" value="1" name="Q1">yes <input type="checkbox" value="0" name="Q1">no</p> <p>One of your high priorities is designing and evolving your business progressively <input type="checkbox" value="1" name="Q1">yes <input type="checkbox" value="0" name="Q1">no</p> <p>Your company culture embraces adopting the best approaches <input type="checkbox" value="1" name="Q1">yes <input type="checkbox" value="0" name="Q1">no</p> <p>You have defined processes, roles, and responsibilities <input type="checkbox" value="1" name="Q1">yes <input type="checkbox" value="0" name="Q1">no</p> <p>Your staff is literate in using a computer for your basic on the job tasks <input type="checkbox" value="1" name="Q1">yes <input type="checkbox" value="0" name="Q1">no</p> <p>You are ready to begin implementing more systematic operations <input type="checkbox" value="1" name="Q1">yes <input type="checkbox" value="0" name="Q1">no</p> <p>You want to expand, grow, or diversify more efficiently <input type="checkbox" value="1" name="Q2">yes <input type="checkbox" value="0" name="Q2">no</p> <p>You effectively communicate the reasons and value of your changes <input type="checkbox" value="1" name="Q3">yes <input type="checkbox" value="0" name="Q3">no</p> <p>You want to adopt changes to smooth out basic team processes <input type="checkbox" value="1" name="Q3">yes <input type="checkbox" value="0" name="Q3">no</p> <p>Your key people will support, advocate, and lead in changes for you <input type="checkbox" value="1" name="Q3">yes <input type="checkbox" value="0" name="Q3">no</p> <p>You view change as a prime mover in your business journey <input type="checkbox" value="1" name="Q3">yes <input type="checkbox" value="0" name="Q3">no</p> <p><input type="text" name="tally" size="5"></p> <p><input type="button" value="tally" name="B1"></p> I have a script where the user selects an item on the main nav and it will display the sub-nav below. It works fine in every browser except Firefox. ANy ideas? http://tinyurl.com/79wlwq3 EDIT: It's just that script that won't work, btw. I tested an alert box for Firefox and it works fine. Hello everybody I am new here and my English is not very good, sorry. I hope this post is in the correct forum.Thank you in advance for helping me out. I am from the netherlands and we are having a problem with a script. I will explain a few things so everything is clear for you. We are a member from a website: www.onderdelenzoeker.nl Through this website customers can ask for used carparts. If we have these parts in stock we can send the customers an email trough this website. (we are loggin in at leden.onderdelenzoeker.nl) We don't have a regular stock and price so every email we send is unique. That is why we are using this script. When we are sending a customer an email, this script will put the parts in our webshop with the prices. The customer will get an email with a unique link and can order the parts and pay trough the internet. But now the problem , this script won't work the first time. If we fill in a form and send it the first time the script won't work (the customer is getting an email but without the link and the parts are not in the webshop). If we fill in the same form a second time and send it the script is working and the customer is getting an email with a link and the parts are in the shop. Now the script is working in IE and we are using Trixie (is the same like greasemonkey is for FF) I hope I have written down all the information you need. And I hope there is somebody who can help me out. Thank you for your time and effort. Nicole This is the script: PHP Code: // ==UserScript== // @name onderdelenzoeker.nl Extractor for ie // @namespace http://www.autodemontage-wlubbers.nl // @description Adds products to the autodemontage-wlubbers.nl webshop width the information form the onderdelenzoeker.nl website when a users request a product. // @date 09.05.2011 // @version 1.0.2 // @require http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js // @include http://leden.onderdelenzoeker.nl/* // ==/UserScript== var merk; var model; var bouwjaar; var base_url = 'http://www.autodemontage-wlubbers.nl/shop/admin/services.php?action='; $(document).ready(function(){ setTimeout('replace_button()',500); }); replace_button = function(){ if($('.info').find('td:eq(7)').length!=0){ merk = $('.info').find('td:eq(7)').html().split(' ')[0]; model = $('.info').find('td:eq(10)').html(); bouwjaar = $('.info').find('td:eq(13)').html().replace(/[^A-Za-z0-9 .]/,''); $('.info:eq(4)').find('button').after('<input type="button" class="button" onclick="addProjectToShop();" style="width:100%" value="Verstuur gegevens naar aanvrager" />'); $('.info:eq(4)').find('button:eq(0)').remove(); $('body').after('<iframe style="display:none;" id="sendFrame" />'); $('#sendFrame').attr('src',base_url+'login&pass=q6pk4mcn5kzy5hppg0bcq'); } setTimeout('replace_button()',1000); } addProjectToShop = function (){ $('body').after('<div style="position:fixed;top:'+(window.innerHeight/2-100)+';left:'+(window.innerWidth/2-200)+';width:400px;height:200px;border:1px solid black;background:white;" id="loadingFrame" ><h1>Sending...</h1></div>'); var length = 10; var sPassword = ""; for (i=0; i < length; i++) { numI = getRandomNum(); while (checkPunc(numI)) { numI = getRandomNum(); } sPassword = sPassword + String.fromCharCode(numI); } var int_ = 200; $('.info:eq(4)').find('label').each(function(){ var parent = $(this).parent().parent().parent(); if(parent.find('input:eq(0)').attr('checked')) { setTimeout('$(\'#sendFrame\').attr(\'src\',\''+base_url+'addProduct&pass=q6pk4mcn5kzy5hppg0bcq&code='+sPassword+'&merk='+merk+'&model='+model+'&bouwjaar='+bouwjaar+'&item='+$(this).html()+'&prijs='+parent.find('input:eq(1)').val()+'&statiegeld='+parent.find('input:eq(2)').val()+'&verzendkosten='+$('#verzendkosten').val()+'&garantie='+parent.find('select option:selected').text()+'\');',int_); int_ = int_ + 200; } }); setTimeout('$(\'#sendFrame\').attr(\'src\',\''+base_url+'logout\');',int_); $('textarea').val($('textarea').val()+"\nU kunt de producten via onze webshop bestellen.\nKlik of kopieer de onderstaande link in uw browser.\nhttp://www.autodemontage-wlubbers.nl/shop/index.php?route=product/product/refcode&refcode="+sPassword); setTimeout('$(\'#loadingFrame\').remove();$(\'#sendFrame\').remove();validate_and_submit();',4000); return false; } getRandomNum = function () { var rndNum = Math.random() rndNum = parseInt(rndNum * 1000); rndNum = (rndNum % 94) + 33; return rndNum; } checkPunc = function (num) { if ((num >=33) && (num <=47)) { return true; } if ((num >=58) && (num <=64)) { return true; } if ((num >=91) && (num <=96)) { return true; } if ((num >=123) && (num <=126)) { return true; } return false; } I must make clear that I am not a javascript programmer; I am simply trying to get this script to work on my website. It functions perfectly locally (with all browsers), but after uploading to my website, it shows the controls at the top, but not the content. Below is the code for the FreeMind Flash Browser which can be found he http://freemind.sourceforge.net/wiki.../Flash_browser It requires 2 additional files, flashobject.js and visorFreemind.swf plus the FreeMind file (*.mm) that stores the content. The FreeMind file that has the content displays perfectly on localhost, but not on the website. I have all of these files in the same directory and have double checked everything, but it still doesn't function on my website. I have other flash files and scripts on the same website in other pages that function perfectly. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="freemind flash browser"/> <meta name="keywords" content="freemind,flash"/> <title>MINDMAPS</title> <script type="text/javascript" src="flashobject.js"></script> <style type="text/css"> /* hide from ie on mac \*/ html { height: 100%; overflow: hidden; } #flashcontent { height: 100%; } /* end hide */ body { height: 100%; margin: 0; padding: 0; background-color: #9999ff; } </style> <script language="javascript"> function giveFocus() { document.visorFreeMind.focus(); } </script></head> <body onLoad="giveFocus();"> <div id="flashcontent" onmouseover="giveFocus();"> Flash plugin or Javascript are turned off. Activate both and reload to view the mindmap </div> <script type="text/javascript"> // <![CDATA[ // for allowing using http://.....?mindmap.mm mode function getMap(map){ var result=map; var loc=document.location+''; if(loc.indexOf(".mm")>0 && loc.indexOf("?")>0){ result=loc.substring(loc.indexOf("?")+1); } return result; } var fo = new FlashObject("visorFreemind.swf", "visorFreeMind", "100%", "100%", 6, "#9999ff"); fo.addParam("quality", "high"); fo.addParam("bgcolor", "#a0a0f0"); fo.addVariable("openUrl", "_blank"); fo.addVariable("startCollapsedToLevel","3"); fo.addVariable("maxNodeWidth","200"); // fo.addVariable("mainNodeShape","elipse"); fo.addVariable("justMap","false"); fo.addVariable("initLoadFile",getMap("blues.mm")); fo.addVariable("defaultToolTipWordWrap",200); fo.addVariable("offsetX","left"); fo.addVariable("offsetY","top"); fo.addVariable("buttonsPos","top"); fo.addVariable("min_alpha_buttons",20); fo.addVariable("max_alpha_buttons",100); fo.addVariable("scaleTooltips","false"); fo.write("flashcontent"); // ]]> </script> </body> </html> hello Devs, i have a website that has lots of videos on it, the other day i saw a mouse over that showed a snippet of the youtube video, it had microsoft across the front it's since been deleted so i cannot show you an example, does anyone know where i can obtain this script please?
I have a mobile website that I am building. The test site is at www.schenkhampton.com/airtex2. The page is built using drop downs. I have anchor tags that I would like to be able to open up the content associated with that image map. The page that I am referring to is www.schenkhampton.com/airtex2/fueldelivery.html If you click on the numbers for the car it takes you down to the right headline. However, I want to be able to place my anchor tag inside of that associated content so it opens up to the content and not involve an extra click from the user. Any ideas would be appreciated. Matt Hello, I'm a novice with java script and I can't figure out why my script will work locally, but not live. Here is the link. http://www4.uwm.edu/recsports/ There is supposed to be a rotating slideshow in the header, but it's just a black box. Thanks! this is the code for input prompt, only works in IE: any ideas why? $('input[type=text][title],input[type=password][title],textarea[title]').each(function(i){ $(this).addClass('input-prompt-' + i); var promptSpan = $('<span class="input-prompt"/>'); $(promptSpan).attr('id', 'input-prompt-' + i); $(promptSpan).append($(this).attr('title')); $(promptSpan).click(function(){ $(this).hide(); $('.' + $(this).attr('id')).focus(); }); if($(this).val() != ''){ $(promptSpan).hide(); } $(this).before(promptSpan); $(this).focus(function(){ $('#input-prompt-' + i).hide(); }); $(this).blur(function(){ if($(this).val() == ''){ $('#input-prompt-' + i).show(); } }); }); Hello, I hope you can help me, I have used a really simple image script which features 3 thumbnails, you click one thumbnail and it loads the image as a larger image. Works perfectly in Google Chrome, Firefox - and then I've come to try in IE8... works perfect BUT javascript error as follows: - Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MDDC; InfoPath.2; .NET4.0C) Timestamp: Fri, 31 Dec 2010 17:14:48 UTC Message: 'document.images.image0' is null or not an object Line: 13 Char: 1 Code: 0 Here is the code, what am I doing wrong? I can't spot it, theres a couple of threads online from 2005 about this script but none have helped me clear the error. Code: <html> <head> <script language="JavaScript"> image0 =new Image(); image1 =new Image(); image2 =new Image(); image0.src ="http://ec.europa.eu/information_society/activities/egovernment/images/project_logos/sample.jpg" image1.src ="http://ec.europa.eu/information_society/activities/egovernment/images/project_logos/sample.jpg" image2.src ="http://ec.europa.eu/information_society/activities/egovernment/images/project_logos/sample.jpg" document.images['image0'].src=image0.src; document.images['image1'].src=image1.src; document.images['image2'].src=image2.src; function image_click(clicks) { if(clicks==0){document.images['large'].src=image0.src;} if(clicks==1){document.images['large'].src=image1.src;} if(clicks==2){document.images['large'].src=image2.src;} } </script> </head> <body> <a href="javascript:image_click(0)"><img src="http://ec.europa.eu/information_society/activities/egovernment/images/project_logos/sample.jpg" height="93" width="123" alt="" name="image0" border="0"/></a> <a href="javascript:image_click(1)"><img src="http://ec.europa.eu/information_society/activities/egovernment/images/project_logos/sample.jpg" width="123" alt="" name="image1" border="0"/></a> <a href="javascript:image_click(2)"><img src="http://ec.europa.eu/information_society/activities/egovernment/images/project_logos/sample.jpg" height="93" width="123" alt="" name="image2" border="0"/></a> <img src="http://ec.europa.eu/information_society/activities/egovernment/images/project_logos/sample.jpg" align="middle" border="0" width="418" height="284" name="large"> </body> </html> Hi, I've written a small script for a website, and strangely enough (or maybe not) it works in Firefox and Chrome but not IE. I'd read about block level inside inline causing this but i'm still not entirely sure. Here is the offending script: Code: function changeImage(image) { if (image == 6) { var vid = document.createElement('object'); vid.width = "700"; vid.height = "370"; vid.id = "photo"; vid.innerHTML = '<param name="movie" value="http://www.youtube-nocookie.com/v/g4cpDgGlFng&hl=en_US&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/g4cpDgGlFng&hl=en_US&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="700" height="370"></embed>'; document.getElementById("body").replaceChild(vid, document.getElementById("photo")); } else { var img = document.createElement('img'); var old = document.getElementById("photo") img.width = "700"; img.height = "370"; img.id = "photo"; img.alt = "Photo of Gippsland Lakehous"; img.src = "images/photos/" + image + ".jpg"; document.getElementById("body").replaceChild(img, old); } The offending line is the long innerHTML one. I'm sure this must be a very hacky way of doing things (incidentally the thing is replacing an image with another image or video depending on what is clicked), but I rarely code at all, so don't know any better Thanks! |