JavaScript - Javascript Error In Joomla
Hi, my website name is marutiindia.in. I am using lof k2 scroller module along with image magnifier plugin developed by Vtem. The problem is I get JS error in scroller module JS file when I try to enable both these extensions at the same time. If I disable image magnifier plugin there is no error. I don't know what are these errors but I get the following error:
Code: Uncaught TypeError: Object #<Object> has no method 'getElement' Class.initialize script_12.js:27 (anonymous function) mootools-more.js:29 i.extend.$owner mootools-core.js:136 (anonymous function) mootools-core.js:131 (anonymous function) Please help me. Thanks. Similar TutorialsI am getting error when using the script below in vm mynxx template by rockettheme in virtuemart Joomla 1.5 - It works fine outside of mynxx User inputs data into a html form- presses "Get Price" button and a price is returned to same form. Problem is that user is unable to submit to cart firebug error - callback is not a function callback(this.responseText); my ajax script Code: function Ajax() { this.instance = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); this.request = function(url, callback) { this.instance.open('GET', url, true); this.instance.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { callback(this.responseText); } } this.instance.send(null); } } function validate(form) { (new Ajax).request('testform.php?width65=' + form.width65.value + '&length65=' + form.length65.value, function(respons) { var prices = eval(respons); form.price.value = prices[0]; form.otherprice.value = prices[1]; }); } I think I have tracked the file down to theme.js and require some code to validate the function. I am new at this and this is way above me - any help would be appreciated Theme.js code - was packed - ie eval(function(p,a,c,k,e,r){e=function(c)...... I have unpacked it Code: var RokVM = {}; RokVM.autoHide = 3; // seconds before auto closing the Panel RokVM.Base= { uri:window.templatePath,start:function() { RokVM.Base.quantityBox(); RokVM.Cart.init() } ,featuredHeight:function(b) { b=$(b); if(!b) { return RokVM.Base } var c=b.getElements(".home-featured-inner"); var d=0; c.each(function(a) { d=Math.max(a.getSize().size.y,d) } ); c.setStyle("height",d) } ,quantityBox:function() { var h=$$(".cart-quantity-box, .home-featured-cartblock"); if(h.length) { h.each(function(b) { var c=b.getElement(".quantity_box_button_up"); var d=b.getElement(".quantity_box_button_down"); var f=b.getElement(".inputboxquantity"); if(!c||!d||!f) { return } var g=f.getValue().toInt(); f.addEvent("keyup",function(e) { e=(new Event(e)).stop(); var a=this.value; if(a<0) { a=0 } if(isNaN(a)) { this.value=1; a=1 } if(e.key=="up") { if($type(this.getValue().toInt())=="number") { this.value=++a } } if(e.key=="down") { if(a>0&&$type(this.getValue().toInt())=="number") { this.value=--a } } } ); f.addEvent("mousewheel",function(e) { e=(new Event(e)).stop(); var a=this.value; if(a<0) { a=0 } if(isNaN(a)) { this.value=1; a=1 } if(e.wheel==1) { if($type(this.getValue().toInt())=="number") { this.value=++a } } if(e.wheel==-1) { if(a>0&&$type(this.getValue().toInt())=="number") { this.value=--a } } } ); c.addEvent("click",function(e) { (new Event(e)).stop(); if($type(f.getValue().toInt())=="number") { f.value=++f.value } } ); d.addEvent("click",function(e) { (new Event(e)).stop(); if(f.getValue().toInt()>0&&$type(f.getValue().toInt())=="number") { f.value=--f.value } } ) } ) } } }; RokVM.Cart= { init:function() { RokVM.Cart.cartPanel=$("cart-panel"); RokVM.Cart.cartButton=$("cart-button"); RokVM.Cart.cartSurround=$("cart-panel-surround"); if(!RokVM.Cart.cartPanel||!RokVM.Cart.cartButton||!RokVM.Cart.cartSurround) { return RokVM.Cart } if(!RokVM.Cart.Fx) { RokVM.Cart.Fx=(new(Fx.Slide)(RokVM.Cart.cartPanel, { duration:400,transition:Fx.Transitions.Expo.easeOut } )).hide() } RokVM.Cart.cartSurround.setStyle("visibility","visible"); RokVM.Cart.cartButton.getFirst("a").addEvent("click",function(e) { (new Event(e)).stop(); if(!RokVM.Cart.cartPanel.getText().length&&!window.webkit) { return } if(!RokVM.Cart.cartPanel.innerHTML.clean().length&&window.webkit) { return } var a=RokVM.Cart.cartButton.getElement("strong"); if(!a||!a.getText().toInt()&&(!RokVM.Cart.cartPanel.getText().length&&!window.webkit)) { return } RokVM.Cart.clicked=true; if(window.fontFx&&window.fontFx.open) { window.fontFx.toggle() } if(window.loginFx&&window.loginFx.open) { window.loginFx.toggle() } RokVM.Cart.Fx.toggle() } ); RokVM.scrollWindow=new(Fx.Scroll)(window); RokVM.Cart.getShortList(); RokVM.Cart.XHRify() } ,XHRify:function() { var b=$$(".addtocart_form"); if(!b.length) { return RokVM.Cart } b.each(function(a) { a.addEvent("submit",RokVM.Cart.add.bindWithEvent(a,true)) } ) } ,add:function(e,c) { (new Event(e)).stop(); (new Ajax(this.getProperty("action"), { data:$(this),evalScripts:true,onComplete:function(r) { var a=new Element('div').setHTML(r); var b=a.getElement('.shop_tip'); RokVM.Cart.getShortList((r.length&&b)?r:false); RokVM.Cart.clicked=c||false } } )).request() } ,getShortList:function(b) { var c= { onComplete:function(a) { RokVM.Cart.update(a,b) } ,evalScripts:true,data: { only_page:1,page:"shop.basket_short",option:"com_virtuemart" } }; (new Ajax(RokVM.Base.uri+"index2.php",c)).request() } ,handleError:function(a) { var b=RokVM.Cart.cartPanel; var c=new Element('div').setHTML(a); var d=b.getElement('.show-cart-button'); var e=c.getElement('.shop_tip').inject((d)?d:b,(d)?'before':'inside') } ,update:function(a,b) { RokVM.Cart.cartPanel.setHTML(a); var c=RokVM.Cart.cartPanel.getElement(".total_products"),total=0; if(c) { total=c.innerHTML.split(" ")[0].toInt() } if(!total) { RokVM.Cart.cartButton.getFirst().setProperty("class","cart-button-desc") } else { RokVM.Cart.cartButton.getFirst().setProperty("class","cart-button-desc-full") } RokVM.Cart.cartButton.getElement("strong").setText(total); if(b)RokVM.Cart.handleError(b); if(RokVM.Cart.clicked&&a.length||b) { if(window.fontFx&&window.fontFx.open) { window.fontFx.toggle() } if(window.loginFx&&window.loginFx.open) { window.loginFx.toggle() } RokVM.scrollWindow.toTop(); RokVM.Cart.show(); RokVM.Cart.hide.delay(RokVM.autoHide*1000) } RokVM.Cart.clicked=false } ,show:function() { RokVM.Cart.Fx.slideIn() } ,hide:function() { RokVM.Cart.Fx.slideOut() } }; window.addEvent("domready",RokVM.Base.start); window.addEvent(window.webkit?"load":"domready",function() { RokVM.Base.featuredHeight("home-featured") } ); var live_site = RokVM.Base.uri; Then following - this in the same theme.js file (this is not packed) Code: /// Following is VM stuff, kept for compatibility /** * This file holds javscript functions that are used by the templates in the Theme * */ // AJAX FUNCTIONS function loadNewPage( el, url ) { var theEl = $(el); var callback = { success : function(responseText) { theEl.innerHTML = responseText; if( Lightbox ) Lightbox.init(); } } var opt = { // Use POST method: 'get', // Handle successful response onComplete: callback.success } new Ajax( url + '&only_page=1', opt ).request(); } function handleGoToCart() { document.location = live_site + '/index.php?option=com_virtuemart&page=shop.cart&product_id=' + formCartAdd.product_id.value ; } function handleAddToCart( formId, parameters ) { formCartAdd = document.getElementById( formId ); var callback = function(responseText) { updateMiniCarts(); // close an existing mooPrompt box first, before attempting to create a new one (thanks wellsie!) /*if (document.boxB) { document.boxB.close(); clearTimeout(timeoutID); } document.boxB = new MooPrompt(notice_lbl, responseText, { buttons: 2, width:400, height:150, overlay: false, button1: ok_lbl, button2: cart_title, onButton2: handleGoToCart }); setTimeout( 'document.boxB.close()', 3000 );*/ } var opt = { // Use POST method: 'post', // Send this lovely data data: $(formId), // Handle successful response onComplete: callback, evalScripts: true } new Ajax(formCartAdd.action, opt).request(); } /** * This function searches for all elements with the class name "vmCartModule" and * updates them with the contents of the page "shop.basket_short" after a cart modification event */ function updateMiniCarts() { var callbackCart = function(responseText) { carts = $$( '.vmCartModule' ); if( carts ) { try { for (var i=0; i<carts.length; i++){ carts[i].innerHTML = responseText; try { color = carts[i].getStyle( 'color' ); bgcolor = carts[i].getStyle( 'background-color' ); if( bgcolor == 'transparent' ) { // If the current element has no background color, it is transparent. // We can't make a highlight without knowing about the real background color, // so let's loop up to the next parent that has a BG Color parent = carts[i].getParent(); while( parent && bgcolor == 'transparent' ) { bgcolor = parent.getStyle( 'background-color' ); parent = parent.getParent(); } } var fxc = new Fx.Style(carts[i], 'color', {duration: 1000}); var fxbgc = new Fx.Style(carts[i], 'background-color', {duration: 1000}); fxc.start( '#222', color ); fxbgc.start( '#fff68f', bgcolor ); if( parent ) { setTimeout( "carts[" + i + "].setStyle( 'background-color', 'transparent' )", 1000 ); } } catch(e) {} } } catch(e) {} } } var option = { method: 'post', onComplete: callbackCart, data: { only_page:1,page: "shop.basket_short", option: "com_virtuemart" } } new Ajax( live_site + '/index2.php', option).request(); } /** * This function allows you to present contents of a URL in a really nice stylish dhtml Window * It uses the WindowJS, so make sure you have called * vmCommonHTML::loadWindowsJS(); * before */ function fancyPop( url, parameters ) { parameters = parameters || {}; popTitle = parameters.title || ''; popWidth = parameters.width || 700; popHeight = parameters.height || 600; popModal = parameters.modal || false; window_id = new Window('window_id', {className: "mac_os_x", title: popTitle, showEffect: Element.show, hideEffect: Element.hide, width: popWidth, height: popHeight}); window_id.setAjaxContent( url, {evalScripts:true}, true, popModal ); window_id.setCookie('window_size'); window_id.setDestroyOnClose(); } Guys, have you had any "positive" experiences with embedding Javascript into joomla 1.7? Is this even possible? Regards, Sam Blythe, @ blanket holder Hello there. I'm using Joomla 1.5 and VirtueMart for my e-shop. I've also installed a virtuemart template which loads mootools. Well in my virtuemart product detail pages, if you click the main image to make it enlarged using IE8 it will not open and return a JS error instead (found it using Firebug): http://goo.gl/6lQCV Code: Message: 'closeButton' is null or not an object Line: 21 Char: 63 Code: 0 URI: http://www.xxxxx.xxx/media/system/js/mootools.js I'm not sure but I think that if I fix the JS errors on these pages the problem will be solved and the images will open normally. Note that on all other browsers it works fine (Firefox, Chrome, Safari, IE9). The page returns some other errors too but they're the whole time there. I think there's a conflict caused by all the JS libraries loaded by my Plugins (System - RokBox & YOOeffects), Joomla template, VirtueMart & VirtueMart template (jquery and mootools are both loaded). Thanks in advance Hello, i am a total newbie, so forgive me i have the following problem: a Joomla Gallery uses a javascript to show fullsize images. but when the popup windows comes out, it doesn't have any properties (page title, url about:blank, blank background etc) here is a screenshot: I think the following to be the code that calls the popup: what's wrong? NOTE I already had to remove some "spaces" from the code because the Joomla SEF was changing the urls forbidding the right execution of everything, maybe it's something like that... dunno :cry: Code: $htmltext2 .= "<script language=\"JavaScript\">"; $htmltext2 .= "function pgpopup(pgimagefile,pgimagetitle,pgimagedescription) {\n"; $htmltext2 .= "var newWindow = window.open(\"\",\"newWindow\",\"height=" . ($tabparams["pgmaxheight"]+$dparm[2]) . ",width=" . ($tabparams["pgmaxwidth"]+$dparm[3]) . ",resizable=yes, scrollbars=yes, toolbar=no " . "\" );\n"; $htmltext2 .= "var imageurl = \"<img src= \"+ pgimagefile + \">\";\n"; $htmltext2 .= "newWindow.document.open();"; $htmltext2 .= "newWindow.document.writeln(\"<div align='center' >\");\n"; $htmltext2 .= "newWindow.document.writeln(\"<title>Profile Gallery Image: \"+ pgimagetitle + \"</title>\");\n"; $htmltext2 .= "newWindow.document.writeln(imageurl);\n"; $htmltext2 .= "newWindow.document.writeln(\"<br />\");"; $htmltext2 .= "newWindow.document.writeln(pgimagedescription);\n"; $htmltext2 .= "newWindow.document.writeln(\"</div>\");\n"; $htmltext2 .= "newWindow.document.close();\n"; $htmltext2 .= "}\n"; $htmltext2 .= "</script>"; break; anyone can help? thanks! Hi friends, Am customizing a Joomla website and i need to know how to get a nice and fine javascript accordion horizontal panel which is so smooth and good looking to add in Joomla Home page. Please suggest me some horizontal javascript accordion with images and link to another page. Thanks in Advance. Hi everyone, Im new to the whole website thing as a whole but my mate got me onto joomla which has been great and iv got a site up im almost happy with and have learnt quite alot about coding etc. My problem is: Im utilising a vertical menu, just simple text as links, i want to add an effect on hover and clicking on that makes the text slide elegantly to the right about 16pixels. I have another unpublished template that iv bought (that doesnt quite work at all, module position all messed up etc) but it does this hover effect perfectly on the menu. So i have the .js file from that template and iv read some tutorials on how to add a js file to my template but its just not doing anything. Is it a good idea to try to add this file from a different template to my template or is there a easier way to do this (what i think is a) simple effect. Thanks. ps i can post the js code if wanted In Joomla I want to create a form that posts values. Of the fields I have a dropdown box, but when a checkbox for "other" is clicked I want a textbox to show. How to I show/hide and post the select box's value or the textbox's value depending on whether the checkbox is checked (along with the other values on the form)? Thanks much for any help. Using Joomla 1.5.26, I'm trying to have Diigo bookmarks show up in an article. Diigo has an API that will fetch the bookmarks and return them in a JSON format. For these bookmarks to be updated, I suppose the page would need to be refreshed; it's not like a Twitter real-time feed... Example API call to: https://secure.diigo.com/api/v2/book...itman&count=10 Here's what's returned: [{"updated_at":"2012/05/14 19:04:31 +0000","url":"http://etc.fdresa.org/index.php?option=com_content&%3Bview=article&%3Bid=93%3A2012-summer-technology-offerings&%3Bcatid=42%3A2012-courses&%3BItemid=2#.T7FW-LgvBMw.diigo","annotations":[],"user":"dritman","readlater":"no","shared":"yes","tags":"etc,technology,courses","created_at":"2 012/05/14 19:04:31 +0000","title":"2012 Summer Technology Offerings","comments":[],"desc":""},{"updated_at":"2012/05/11 16:51:38 +0000","url":"http://etc.fdresa.org/index.php?option=com_content&%3Bview=article&%3Bid=94%3Alive-feeds&%3Bcatid=43%3Alinks&%3BItemid=50#.T61DemaIB_w.diigo","annotations":[],"user":"dritman","readlater":"no","shared":"yes","tags":"no_tag","created_at":"2012/05/11 16:51:38 +0000","title":"Live feeds","comments":[],"desc":"Testing"}] How do I go about parsing this JSON info into a readable format within a Joomla article? Thanks! Hello I'm having trouble with ignitegallery in Joomla. I installed it and created a gallery, but it doesn't seem to work properly. The image doesn't load, only the thumbnails. And in firebug, it says this: $(this.options.largeImage).getElement is not a function - what does that mean? Here's the link to the gallery: http://saintella.com/index.php?optio...id=1&Itemid=6# Thanks for any help in advance. Hey guys, I'm a student taking JavaScript classes, I really like it so far and hope to really understand it in the next couple weeks. I'm doing my homework and just successfully coded a calendar (didn't take me very long, like I said, I'm catching on pretty quick and having fun) Having said that I'm not interested in getting any coding help, I simply like to further understand what I'm doing because I'm taking an online class. I'm going to show you my html and javascript file and I really need to understand why my address footer is in the middle? I have some HTML knowledge and know that since I put the address code at the bottom it should show up at the bottom. I deleted the linked .js file and it suddenly appeared at the bottom, therefore I'm thinking it has something to do with my javascript code. Does javascript act differently? Like I said, I'm not looking for anyone posting any kind of code, I'm just trying to understand what it is doing. Code: <title>Yearly Calendar</title> <link href="styles.css" rel="stylesheet" type="text/css" /> <link href="yearly.css" rel="stylesheet" type="text/css" /> <script src="yearly.js" type="text/javascript"></script> </head> <body> <div id="head"> <img style="float: right; border: 1px solid orange" src="photo.jpg" alt="" /> <img src="ccc.jpg" alt="Chamberlain Civic Center" /> </div> <div id="links"> <table><tr> <td><a href="#">Home</a></td><td><a href="#">Tickets</a></td> <td><a href="#">Events</a></td><td><a href="#">Directions</a></td> <td><a href="#">Hours</a></td><td><a href="#">Calendar</a></td> <td><a href="#">Tour</a></td><td><a href="#">Contact Us</a></td> </tr></table> </div> <div id="main" align="center"> <h1>Yearly Calendar</h1> <center><script type="text/javascript"> yearly() </script> </center> </div> <address> The Chamberlain Civic Center · 2011 Canyon Drive · Chamberlain, SD 57325 · (800) 555-8741 </address> </body> </html> Code: function yearly(calDate) { if (calDate == null) calendarDay=new Date() else calendarDay = new Date(calDate); var currentTime= calendarDay.getTime(); var thisYear= calendarDay.getFullYear(); document.write("<table id='yearly_table'><tr>"); document.write("<th id='yearly_title' colspan='4'>"); document.write(thisYear); document.write("</th>"); document.write("</tr>"); var monthNum = -1; for (var i=1; i<=3; i++) { document.write("<tr>") for (var j=1; j<=4; j++) { monthNum++; calendarDay.setDate(1); calendarDay.setMonth(monthNum); writeMonthCell(calendarDay, currentTime); } }write.document("</tr>"); write.document("</table>") } function writeMonthCell(calendarDay, currentTime) { document.write("<td class='yearly_months'>"); writeMonth(calendarDay, currentTime); document.write("</td>"); } function writeMonth(calendarDay, currentTime) { document.write("<table class='monthly_table'>"); writeMonthTitle(calendarDay); writeDayNames() writeMonthDays(calendarDay, currentTime); document.write("</table>"); } function writeMonthTitle(calendarDay) { var monthName = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); var thisMonth=calendarDay.getMonth(); document.write("<tr>"); document.write("<th class='monthly_title' colspan='7'>"); document.write(monthName[thisMonth]); document.write("</th>"); document.write("</tr>"); } function writeDayNames() { var dayName = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat"); document.write("<tr>"); for (var i=0;i<dayName.length;i++) { document.write("<th class='monthly_weekdays'>"+dayName[i]+"</th>"); } document.write("</tr>"); } function daysInMonth(calendarDay) { var thisYear = calendarDay.getFullYear(); var thisMonth = calendarDay.getMonth(); var dayCount = new Array(31,28,31,30,31,30,31,31,30,31,30,31); if ((thisYear % 4 == 0)&&((thisYear % 100 !=0) || (thisYear % 400 == 0))) { dayCount[1] = 29; } return dayCount[thisMonth]; } function writeMonthDays(calendarDay, currentTime) { var weekDay = calendarDay.getDay(); document.write("<tr>"); for (var i=0; i < weekDay; i++) { document.write("<td></td>"); } var totalDays = daysInMonth(calendarDay); for (var dayCount=1; dayCount<=totalDays; dayCount++) { calendarDay.setDate(dayCount); weekDay = calendarDay.getDay(); writeDay(weekDay, dayCount, calendarDay, currentTime); } document.write("</tr>"); } function writeDay(weekDay, dayCount, calendarDay, currentTime) { if (weekDay == 0) document.write("<tr>"); if (calendarDay.getTime() == currentTime) { document.write("<td class='monthly_dates' id='today'>"+dayCount+"</td>"); } else { document.write("<td class='monthly_dates'>"+dayCount+"</td>"); } if (weekDay == 6) document.write("</tr>"); } I really can't figure this out... Hopefully you guys may have an idea. Basically I have an Ajax chat that stores a cookie. The first thing it does is checks to see if a cookie is set, if it's not it loads a box to where you can type your name (if it is it skips this), then it allows you to chat. The way I have this set up is on the index, I have a command that loads a php file. I pass through the html a variable... Code: ajaxFunction(3); When it gets to ajaxFunction(funct) I have this script; Code: if(funct == 1){ var source="file2.php"; var name = document.getElementById('name').value; status = 1; var queryString = "?name=" + name + "&status=" + status; } if(funct == 2){ var source="file1.php"; var shout = document.getElementById('shout').value; var color = document.getElementById('color').value; var bold = document.getElementById('bold').value; var queryString = "?shout=" + shout + "&color=" + color + "&bold=" + bold; } if(funct == 3){ var source="file2.php"; var name = document.getElementById('dfdf').value; status = 2; var queryString = "?name=" + name + "&status=" + status; } When the program first loads, it runs command 3 which checks to see if a cookie is set. If it is set, it returns a form Code: ................<INPUT TYPE=\"checkbox\" NAME=\"bold\" ID=\"bold\"> <input type=\"button\" onclick=\"ajaxFunction(2)\" value=\"Shout\"> ajaxFunction 2 then loads the chat box. If the cookie isn't set, it loads ajax function(1) which prompts their user for the name. The prompt for the name and the test for the cookie are in the same php file. I have it to where it gets the "status" and it runs the test in this order. PHP 1. Check to see if the person has a cookie (regardless to status) if true, run file1.php 2. If the person does not have a cookie set but status = 2, returns the prompt for the user to set a name. Code: echo "<form name=\"cookiedata\"> Name: <input type=\"text\" name=\"name\" id=\"name\" onChange=\"ajaxFunction(1)\" onkeypress=\"{if (event.keyCode==13)ajaxFunction(1)}\"> <input type=\"button\" onclick=\"ajaxFunction(1)\" value=\"Save\"> </form> "; //note, this actually replaces a div on the main page and does the prompt 3. If the person has a name set and is setting a cookie now, status = 1 then run file1.php Now the weird thing is, This thing works entierly on firefox... but for some reason when it loads in ie, i don't get the chat box. I don't get any errors either. For some reason, it doesn't seem to like the variable that is passed through to the php which is done like Code: var command = ""+source+""+queryString+""; ajaxRequest.open("GET", command, true); and recieved by php like Code: <?php include('config.php'); $status=$_GET['status']; $name = $_GET['name']; if($status==1){ do some code }else if($status==2){ do some code }.....................?> What is going on? How do I fix this with out splitting up the file in to two files? (before, it went to two seperate files, and it worked great... now they are both in the same file with a condition statement and nothing is working?) I have a script: PHP Code: <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"> try { var pageTracker = _gat._getTracker("UA-13289331-1"); pageTracker._trackPageview(); } catch(err) {}</script> But firefox detects here an error which is: error: PHP Code: missing ) after argument list [Break on this error] document.write(unescape("%3Cscript src..."text/javascript"%3E%3C/script%3E"));n How I can fix that, because I didn't see what is wrong with ) symbol. Hy guys i have this error uncaught exception: [Exception... "Could not convert JavaScript argument" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: http://www.tgi.com.pt/merdo/scroll/ :: anonymous :: line 435" data: no] the problem is this code Code: <script type="text/javascript"> var gal = { init : function() { if (!document.getElementById || !document.createElement || !document.appendChild) return false; if (document.getElementById('gallery')) document.getElementById('gallery').id = 'jgal'; var li = document.getElementById('jgal').getElementsByTagNa me('li'); li[0].className = 'active'; for (i=0; i<li.length; i++) { li[i].style.backgroundImage = 'url(' + li[i].getElementsByTagName('img')[0].src + ')'; li[i].style.backgroundRepeat = 'no-repeat'; li[i].title = li[i].getElementsByTagName('img')[0].alt; gal.addEvent(li[i],function() { var im = document.getElementById('jgal').getElementsByTagNa me('li'); for (j=0; j<im.length; j++) { im[j].className = ''; } this.className = 'active'; }); } }, addEvent : function(obj, type, fn) { if (obj.addEventListener) { obj.addEventListener(type, fn, false); } else if (obj.attachEvent) { obj["e"+type+fn] = fn; obj[type+fn] = function() { obj["e"+type+fn]( window.event ); } obj.attachEvent("on"+type, obj[type+fn]); } } } gal.addEvent(window,'load', function() { gal.init(); }); </script> I thin this is a conflict between fancybox plug in and the script above http://www.tgi.com.pt/merdo/scroll/ I really need help... Thanks I was working on this script to change text with javascript and I ran into a problem. The code goes like this: PHP Code: <area shape="rect" coords="128,174,256,203" href="#" onClick="document.getElementById('content').innerHTML='<p class=first>Welcome to the first release of my Now every time I use an apostrophe in a word then when I click the link that corresponds to that writing, it doesn't do anything. Here's the link to my website: http://bittipiilo.com/msx/ By default you are on the Home tab. Then when you click either Gallery or Services and try to go back to Home, nothing happens. Can someone help me? I am getting an error with a script and can't seem to figure out the problem. Firebug Error message: Error: document.forms[myform] is undefined Source File: https://www.domain.com/js/remember.js Line: 24 I have attached the HTML page and the remote javascript file. The script instructions said to include an onload action in the <BODY> tag as follows: <body background="/images/gold2.gif" onLoad="loadCookie(); displayFormData('my_form');"> BUT I was trying to use an even loader in the remote js file instead. Any help would be greatly appreciated. When running my PHP code locally I am recieving the following error: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; BTRS26718; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.2; OfficeLiveConnector.1.5; OfficeLivePatch.1.3; Tablet PC 2.0) Timestamp: Thu, 7 Apr 2011 15:47:06 UTC Message: Object doesn't support this property or method Line: 4 Char: 1 Code: 0 URI: http://localhost/MowingSch.php ********************* * Selected Code ********************* Code: // JavaScript <script type='text/javascript'> function insCell(p1){ var wi = document.getElementById('Mowing').getElementsByName(p1).getElementsByTagName('td').length; if (wi == 3) { var x=document.getElementById(p1).insertCell(3); x.innerHTML='<?PHP echo $n; ?>'; var x=document.getElementById(p1).insertCell(4); x.innerHTML='<?PHP echo $p; ?>'; var x=document.getElementById(p1).insertCell(5); x.innerHTML='<?PHP echo $e; ?>'; } else { alert('Date selected is already assigned!'); } } </script> Code: // PHP Code $x = 0; for ($r = 0; $r <=27; $r++){ $id = 'tr'.$r; echo "<tr id=$id><TD><input id='SignUp' name=$id type='image' src='mow.png' name='mow' onclick='insCell($id)'></TD>"; for ($c = 0; $c <= 4; $c++) { if($data[$x + $c] <> ''){ echo "<td>" . $data[$x + $c] . "</td>"; } } echo "</tr>"; $x = $x + 5; } Would appreciate ANY assistance! Thanks. Hi, I have a little problem with placing a javascript into a php script If the action "Change" is true then I want to open a new window with a javascript below. I get an error message: Parse error: syntax error, unexpected '<' in /home/........ on line xx On that xx line starts the Javascript What must I do to solve this problem. <?php.................... if($_REQUEST['action']=="Change") { mysql_query("UPDATE Persons SET Itemstate = '{$_REQUEST['Nr']};' WHERE Nr={$_REQUEST['Nr']};"); <SCRIPT LANGUAGE="javascript"> <!-- window.open ('Examplepage.html') --> </SCRIPT> ........ ?> Hi Everyone, Iv got a button in my HTML5 document that when clicked gives an error. The button is coded as follows: Code: <input type="button" onclick="startGame();" value="Play!" /> The startGame function is held in an external JavaScript file. Whenever i run the code and click on the button i get an error that says startGame is not defined. Any ideas? Thanks, Luke My website has 11 drop down lists containing different data fields. getvalues(), getvalues_1(),...getvalues_10() are user defined functions which store the value of the data field selected by the user from the drop down list. And then using Switch case statement I assign a particular value to a variable depending on what value the user selected from the drop down list. When I checked the code using 'Firebug' error console, I got two different kinds of syntactical errors, such as: 1. Error: syntax error Line: 484, Column: 36 Source Code: var groom_age = function getvalues(); <- The first kind of error points towards the semicolon And the error was present for all the 11 drop down lists (all pointing towards the semicolon) Now, when I removed the semicolon while calling the function get_values(), I got a second type of syntax error: 2. syntax error: switch (groom_age) . Error for all switch case statements The deceleration of the function getvalues() is as follows: Code: <script type = "text/javascript"> function getvalues() { var val = document.Age.Groomage.value; var si = document.Age.Groomage.selectedIndex; if (si != 0) { var textval = document.Age.Groomage.options[si].text; return textval; } } </script> The JavaScript code for the Switch Case statement is as follows: Code: <script type="text/javascript"> var age; var groom_age = function getvalues() switch(groom_age) { case '23': age = 1.6; break; case '24': age = 1.8; break; case '25': age = 1.7; break; case '26': age = 1.8; break; case '27': age = 1.9; break; case '28': age = 1.75; break; case '29': age = 1.7; break; case '30': age = 1.4; break; case '31-35': age = 1.8; break; case '36-40': age = 1.9; break; case '41-45': age = 1.75; break; case '46-50': age = 1.7; break; case '51+': age = 1.4; break; default: alert ('Please select an option'); } </script> <script type="text/javascript"> var caste; var groom_caste = function getvalues_1() switch(groom_caste) { case 'Brahmin' : caste = 2.0; break; case 'Bania': caste = 1.8; break; case 'Kayastha' : caste = 1.6; break; case 'Kshatriya' : caste = 2.0; break; case 'Dalit': caste = 1.8; break; case 'Maravar' : caste = 1.6; break; case 'Mudaliar' : caste = 2.0; break; case 'Jat': caste = 1.8; break; case 'Labanas' : caste = 1.6; break; case 'Rajput' : caste = 1.6; break; default : alert ('Please select an option'); } </script> . . . . Other Switch Case Statements . . <script type="text/javascript"> var father; var groom_father = function getvalues_10(); switch(groom_father) { case 'Doctor': father= 1.8; break; case 'IAS': father = 2.0; break; case 'Engineer': father= 1.7; break; case 'Lawyer': father= 1.65; break; case 'CA': father= 1.8; break; case 'Engineer + MBA': father= 1.9; break; case 'Family Business': father= 1.2; break; default : alert ('Please select an option'); } </script> Can someone please point out to me the mistake in the code? I would be really grateful. Thanks a lot! Hi everybody. I've been trying to figure out how to fix the following error I get in the latest Internet Explorer for marinebio.org: Message: 'this.submenus[...].getElementsByTagName(...).0' is null or not an object Line: 547 Char: 3 Code: 0 URI: http://marinebio.org/_n/s/main.js The code at line 547 in main.js is: Code: this.submenus[i].getElementsByTagName("span")[0].onclick = function() { in the function: Code: SDMenu.prototype.init = function() { var mainInstance = this; for (var i = 0; i < this.submenus.length; i++) this.submenus[i].getElementsByTagName("span")[0].onclick = function() { mainInstance.toggleMenu(this.parentNode); }; if (this.markCurrent) { var links = this.menu.getElementsByTagName("a"); for (var i = 0; i < links.length; i++) if (links[i].href == document.location.href) { links[i].className = "current"; break; } } if (this.remember) { var regex = new RegExp("sdmenu_" + encodeURIComponent(this.menu.id) + "=([01]+)"); var match = regex.exec(document.cookie); if (match) { var states = match[1].split(""); for (var i = 0; i < states.length; i++) this.submenus[i].className = (states[i] == 0 ? "collapsed" : ""); } } }; I've been using the Dynamic Drive's Slashdot sliding menu script for at least a year without any problems. All pages validated before the ads were added. I've pulled nearly all other scripts but it still errors out. Works fine in FF and Chrome. Going to strip the home page to nothing and start building it back but if anyone has any ideas, I'd really appreciate it. Maybe it's time to upgrade the vertical sliding menu script entirely, if anyone can recommend a better one, that would be great too. I know just enough javascript to be dangerous apparently.... |