JavaScript - Object Doesn't Support This... Errors
Hey Guys,
I've been working on a WP site that uses a handful of plugins - several of which include java-script files. I've been having trouble with one of the plugins and have started the debugging process and noticed that the page the problem is occurring on shows a few java-script errors. http://proshotsrange.com/test-contact-page/ What do the "Object Not Supported" errors mean - and what would it entail to fix them? Thanks in advance. Code: Webpage Error Details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0) Timestamp: Mon, 22 Nov 2010 16:43:02 UTC Message: Object doesn't support this property or method Line: 143 Char: 2 Code: 0 URI: http://proshotsrange.com/wp-content/plugins/wp-e-commerce/js/wp-e-commerce.js?ver=3.7.58 Message: Object doesn't support this property or method Line: 4621 Char: 7 Code: 0 URI: http://proshotsrange.com/wp-includes/js/prototype.js?ver=1.6.1 Message: 'style' is null or not an object Line: 33 Char: 6 Code: 0 URI: http://proshotsrange.com/wp-content/plugins/lightbox-2/lightbox.js?ver=1.8 Similar TutorialsMy website is working perfectly on Firefox but when I visit it with IE(7), I get the following errors and some things aren't where they're supposed to be. Quote: Webpage Script Errors User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.5.30729; .NET CLR 3.0.30618) Timestamp: Fri, 25 Sep 2009 08:31:56 UTC Message: Object doesn't support this property or method Line: 8 Char: 186 Code: 0 URI: http://icarwakim.com/media/system/js/mootools.js Message: Object doesn't support this property or method Line: 59 Char: 102 Code: 0 URI: http://icarwakim.com/media/system/js/mootools.js Website: http://www.icarwakim.com Any advise? I'm Sunita. I am working in ASP .net . I have created Class1.dll file . and in javascript I am creating ActiveXobject . when i debug the application . Its gives error like Object doesn't support this property or method. my code is Code: Class1.cs using System; using System.Collections.Generic; using System.Text; using System.IO.Ports; namespace Ana7140 { public class Class1 { //Declare Variables string data = ""; string log = ""; bool DoneDataReceived = false; bool tare = false; private SerialPort comport = new SerialPort(); public void send() { //Send comport comport.Write("?1"); if (data.Length > 1) { data = data.Replace('\r', ' '); char sign = data[1]; string DelimeterStr = "+-"; char[] delimiter = DelimeterStr.ToCharArray(); string[] splited = null; splited = data.Split(delimiter); data = Convert.ToString(sign) + Convert.ToString(Convert.ToDouble(splited[1])); } else { data = ""; } } public string GetValue() { //Send command to port if (comport.IsOpen) { if (tare == true) { comport.Write("?1"); log = log + "Sent ?1 command"; //if (data.Length > 1) //{ // data = data.Replace('\r', ' '); // char sign = data[1]; // string DelimeterStr = "+-"; // char[] delimiter = DelimeterStr.ToCharArray(); // string[] splited = null; // splited = data.Split(delimiter); // data = Convert.ToString(sign) + Convert.ToString(Convert.ToDouble(splited[1])); //} //else //{ // data = ""; //} while (true) { if (DoneDataReceived == true) { DoneDataReceived = false; break; } } tare = false; }//end of if(tare==true) else { data = "-2"; } } else { data = "-1"; } //This will return the data only return data; } //To fetch the data from Serial Port public void port_DataReceived(object sender, SerialDataReceivedEventArgs e) { try { if (comport.IsOpen) { //Reading Data from Serial Port data = comport.ReadLine();//.ReadExisting(); log += data; // GetValue(); if (data.Length > 1) { data = data.Replace('\r', ' '); char sign = data[1]; string DelimeterStr = "+-"; char[] delimiter = DelimeterStr.ToCharArray(); string[] splited = null; splited = data.Split(delimiter); data = Convert.ToString(sign) + Convert.ToString(Convert.ToDouble(splited[1])); } else { data = ""; } DoneDataReceived = true; //Done with data processing } } catch (Exception ex) { //MessageBox.Show(ex.Message); } } public string getLog() { return log; } //This Function initialiases the serial port //public void Initialise() //{ // try // { // isInitialise = true; // correct = false; // init = true; // //sending command to serial port for initialization // //comport.Write("*\n"); // } // catch (Exception ex) // { } //} public void Tare() { try { //sending command to serial port for initialization comport.Write("T\n"); tare = true; } catch (Exception ex) { } } //This function opens the comport public void Start() { try { //if previously comport is open the firstly close this connection then open again comport if (comport.IsOpen) { comport.Close(); } else { //set Baudrate value as 300 comport.BaudRate = 300; //to read data in string set Data bits as 8 comport.DataBits = 8; //set stop bits as 1 comport.StopBits = (StopBits)1; //set parity bit as None comport.Parity = (Parity)Enum.Parse(typeof(Parity), "None"); //Set Port Name as COM1 //comport.PortName = "COM1"; //Set Read Time Out as 100 comport.ReadTimeout = 100; //Open comport comport.Open(); //Call event for serial data received comport.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived); //data = ""; // comport.Write("?1"); } } catch (Exception ex) { } } //close the connection and close the comport public void Stop() { try { //check whether comport is open or not //if comport is open then close the comport if (comport.IsOpen) { //comport.ReadExisting(); comport.Close(); } } catch (Exception ex) { } }//End of Stop //To check Connection is Opened or not public string getStart() { string check = ""; try { if (comport.IsOpen) { check = "0"; //If the connection is opened,then check=0 } else { check = "-1"; //If the connection is closed,then check=-1 } }//End of try catch (Exception ex) { } return check; }//End of getStart } } JavaScript program is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head><title> Untitled Page </title> <script language="javascript"> var wshell; wshell=new ActiveXObject("Ana7140.Class1"); function GetVal() { var val= wshell.GetValue(); alert(val); } function setip() { wshell.Start(); wshell.Initialise(); alert(val); } function Stop() { wshell.Stop(); //alert(val); // wshell.Stop(); //alert(val); } function Tares() { wshell.Tares(); //alert(val); // wshell.Stop(); //alert(val); } </script> </head> <body> <form name="form1" method="post" id="form2"> <div> <a href="#" onclick="javascript:setip()"> Connect </a> <a href="#" onclick="javascript:GetVal()"> Acquire Weight </a> <a href="#" onclick="javascript:Stop()"> Disconnect </a> <a href="#" onclick="javascript:Tares()"> Tares </a> </div> </form> </body> </html> plz help me I have looked at the various posts about setting onclick in IE and I cannot see any that exactly describe the problem I am having. Firstly I am not trying to set onclick by calling setAttribute, which most of the posts describe. I am simply assigning a value to the onclick attribute of the element, which those posts seem to imply. Specifically I am getting "Object doesn't support this action" on the following line: Code: editButton.onclick = editCitation; editCitation is already a function, so I do not see why I should have to wrap it in an anonymous function wrapper to get IE to permit the assignment. for (var i=0; i < document.myform.registrationtype.length; i++) { if (document.myform.registrationtype[i].checked) { var registrationtype = document.myform.registrationtype[i].value; } } what is wrong with this? i'm trying to get the value of registrationtype (a radio box) i'm getting an error object doesn't support this propery or method Hi All, Need some urgent. We are having a javascript which is throwing the foll error "Object doesn't support this property or method". The javascript function being called is using a Scanner API. So this is using some ActiveX. Below is the code for javascript <script language="javascript"> // Initialize scanning function OnLoad() { try { Scanner.OpenScanner(); // Scanner.ScanPriority = 0; // Set scanner to Foreground Read mode before enable scanning // Scanner.EnableScanning(1); document.forms["mobileform"]["rm07m-bwartwe[1]"].value = "101"; } catch (e) { alert(e.message); } } // Clean up function OnUnload() { Scanner.CloseScanner(); // Calling Dispose is necessary for Pocket IE because of a Microsoft issue related to releasing object. if (navigator.appName == "Microsoft Pocket Internet Explorer") Scanner.Dispose(); } // Scan through soft trigger function Scan() { try { Scanner.SetSoftTrigger(1); } catch (e) { alert(e.message); } } //User-defined function to format error codes. //VBScript has a Hex() function but JScript does not. function hex(nmb) { if (nmb > 0) return nmb.toString(16); else return (nmb + 0x100000000).toString(16); } </script> There is a object tag in html <object id="Scanner"></object> The javascript functions are called from body tag. Can someone please provide some help. Thanks, Nikhil I found strange for the following code: Code: var allextRules = Ext.util.CSS.getRules(); Object.keys(allextRules).forEach(function(key) { var keyname = key; if(keyname.indexOf("js") != -1){ Ext.util.CSS.removeStyleSheet(keyname); console.log(keyname + " Removed"); } }); When the above work is tested in other browser (say - Google Chrome), there is no error. However, when tested in IE 9, there is error as follows: Code: SCRIPT438: Object doesn't support property or method 'keys' According to this article (https://developer.mozilla.org/en/Jav...ts/Object/keys), the Object.keys is supported by IE. Have I miss out something? Hi, I am trying to run multiple videos in the JW player by clicking on different links.Its working fine in chrome and firefox, But it doesn't play viseos in IE. Kindly suggest me ...Thanks in advance..Here is the code. <script type="text/javascript"> function start(){ return playVideo("mediaspace","mediawindow"); } function playVideo(sourceId, targetId) { if (typeof(sourceId)=='string') {sourceId=document.getElementById(sourceId);} if (typeof(targetId)=='string') {targetId=document.getElementById(targetId);} targetId.innerHTML=sourceId.innerHTML; return false;} </script> <body onload="start()"> <div id="mediawindow"></div> <div id="mediaspace" class="fltrt" style="display:none"> <script type='text/javascript' > var so = new SWFObject('player.swf','mpl','360','295','9'); so.addParam('allowfullscreen','true'); so.addParam('allowscriptaccess','always'); so.addParam('wmode','opaque'); so.addVariable('playlistfile','IIA2010.xml'); so.addVariable('stretching','fill'); so.addVariable('autostart','true'); so.addVariable('repeat','list'); so.addVariable('skin','stormtrooper.zip'); so.write('mediaspace');</script></div> <p><a href="#" onclick='return playVideo("mediaspace","mediawindow")'>Play all</a><br /> <a href="#" onclick='return playVideo("welcome","mediawindow")'>MC Linda Clark welcomes guests</a><br /></p> You can also have a look on the webpage. Its working well in FF and chrome. you can test it there. http://www.internetindustryawards.co.nz/2010.html Its really urgent... Is there a way to redirect your site to another site if the browser doesn't support HTML 5? So, if you where using an old version of IE or Firefox that didn't support HTML 5 it would redirect them to another page. Hello I am in need of help desperatley. I am trying to get a video to launch from my homepage. see test homepage here http://www.nuviewinc.com/index3.html the video should pop up and play. Like it does here- http://www.nuviewinc.com/testv.html But it doesnt... can anyone help this poor marketing manager with coding? I simply followed the directions here http://www.vmatrixonline.com/vplayer...structions.pdf. all the code appears correct. Hi, When I try and geocode an addres to my google map I receive the error: Object does not support this method or property I have gone over the script and can't work out what I did wrong. Code: <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html {height:250px} body {height:250px} #bookmark_map {width:90%; height:250px; margin-left:15px;} </style> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true" /> </script> <script type="text/javascript"> var geocoder; var map; function createGMapFromAddress(){ geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(0,0); var map_options = { zoom: 4, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("bookmark_map"), map_options); } function loadBookMarkMap(location){ alert(location); var address = location; alert(address); geocoder.geocode({address: address}, function(results, status){ if (status == google.maps.GeocoderStatus.OK && results.length){ if (status != google.maps.GeocoderStatus.ZERO_RESULTS){ map.set_center(results[0].geometry.location); var marker = new google.maps.Marker({ position: results[0].geometry.location, map: map }); } } else { alert("Geocode was unsuccessful due to: " + status); } }); alert(marker); } </script> </head> <body onload="createGMapFromAddress()"> //php get from table $possumshaw ="{$row['address']}"; } echo '<input type="button" class="button4" value="View Map" onclick="loadBookMarkMap(\'' . $possumshaw . '\')" />'; ?> This is a code for a simple calculator that requires the input of an Area and then calculates how many packs of product are then required to cover that area, rounding up to the next full pack, The results should be displayed in a simple HTML form but its not happening. I can't see any obvious errors. Am I missing something. Any help or ideas would be greatly appreciated. I might be making this more complicated than necessary. Thanks In the <HEAD> Code: <script> function packCalculation(){ if ( document.getElementById('coverage').value == '' ) { alert('You must enter a number') return false; } var coverage = parseFloat(document.getElementById('coverage').value); //declare coverage variable--> if (isNaN(coverage)) { alert('Please only enter numbers') return false; }; var coverage = parseFloat(document.getElementById('coverage').value); var packSize = parseFloat(document.getElementById('pack-size').innerHTML); var price = parseFloat(document.getElementById('price').value); var packNumFinal = coverage/packSize; <!--work out how many packs are needed--> var finalPrice = packNumFinal*price; <!--work out final price --> document.getElementById('packsNeeded').innerHTML = packNumFinal.ceil(); <!--round up to the next full pack--> document.getElementById('calcPrice').innerHTML = parseFloat(finalPrice).toFixed(2); <!--fix to 2 decimal points--> document.getElementById('results').className='show'; return false; } </script> Then in the <BODY> Code: <form id="packC"> <label>Enter Area to cover ( sq m ):</label> <input type="text" name="coverage" id="coverage" /> <p><span>Pack Coverage (sq m):</span> <span id="pack-size">1.982</span></p> <input type="hidden" name="price" id="price" value="<?php echo $priceFormat; ?>" /> <input type="button" value="Calculate" id="calculate" onclick="packCalculation()"/> <!-- results --> <span class="packs">Packs:</span> <div id="packsNeeded"></div><br/> <span class="cost">Total:</span> <div id="calcPrice"></div> </form> Hey everyone, I'm a newbie writing a tic tac toe program using OOP. It was simple setting it up so that a player could click on a box to put an X or an O there, but I've run into serious issues when trying to make it so a player couldn't overwrite the AI's choice and the AI couldn't overwrite the player's. An example of this would be if I made the top right box an X and the AI then made the center box an O, and then I accidentally clicked the center box and made it into an X. I want to prevent that. Every box on the grid is an object with the property of "taken" that helps the program know if a box is empty or not, so as to avert any overwriting in the first place. If the box is empty, this.taken = 0. If the box is filled by a player, taken = 1. If filled by AI, taken = 2. I made it matter whether it was AI or human so later i can check if one of them got tic tac toe. Anyway, by default the constructor class sets this.taken = 0. But the method for checking availability and writing the X or O uses a switch which checks if taken = 0. If it is, it sets taken to either 1 or 2 and writes the necessary symbol. If taken = 1 or 2, it just alerts the player that the spot is taken. But for some reason the switch statement can't tell when taken = anything other than 0. It always executes the code for 0 even though the code for 0 inherently makes it so that taken never equals 0 again, which means case 0 cannot happen anymore. Below is the code with notes. Code: function main(input){//start of main function// function Click(who, where, what){ //this is the method for checking if it's taken or not and writing the X or O if it isn't// /*the argument who represents a number. 0 is no one, 1 is human, 2 is AI; where is a string literal representing the spot on the grid*/ switch(this.taken){ case 0: this.taken = who; document.getElementById(where).innerHTML = what; break; case 1: alert("this spot is taken"); break; case 2: alert("this spot is taken"); }//end switch }//end Click function Box(inputhere){//start of class// this.taken = 0; this.pick = Click; } //end of Box class// //object declarations (I cut out most of them and left only the relevant ones// var topleft = new Box(); var topmid = new Box(); var topright = new Box(); var centerright = new Box(); //end of object declarations// switch (input){ /*in each .pick(), the first arg is whether or not a player chose it (1 = player did, 2 = comp did). The second arg is which box and the third is whether to put an X or O. The input variable in the switch statement is an argument passed through main() when the player clicks on a box. Topleft passes 1.1, topmid passes 1.2 and so on.*/ case 1.1:{ //The first instance of .pick() in each case is what the player did. The second is what the AI will do in repsonse.// topleft.pick(1, "topleft", "X"); topmid.pick(2, "topmid", "<span>O</span>"); break; }//end of case 1.1 case 1.3:{ topright.pick(1, "topright", "X"); centerright.pick(2, "centerright", "<span>O</span>"); break; }//end of case 1.3 }//end of switch }//end of main// Is there anyone who has any idea why on earth this is happening? I've been at it for an embarrassing amount of hours. Also, thanks to anyone who even considers helping : ) (feel free to flame me if my code sucks or my post is too long or anything). Hi, every time I try and alert: [ { number:0, secondnumber:0 }, { number:2, secondnumber:1 }, { number:1, secondnumber:2 } ] it just shows [object object], [object object], [object object]. Why is this and what can I do to make the record be shown as it is above in an alert? Thanks. I can't get any info from Firebug except that one line, uncaught exception [object Object]. The code fully worked, then I needed to make it dynamically create Sortables from the scriptaculous library based on how many X were in a table in my database, which I've done, and I'm thinking it may be a simple slight parse error of some type, I'm not too good with Javascript, because now my script barely works. I've double checked the script's source code, the PHP variables are exactly what they should be. Code: print<<<HERE Sortable.create('sortlist$box', { tag: 'img', overlap:'horizontal',constraint:false, containment: $list, dropOnEmpty: true, onChange: function(item) { var list = Sortable.options(item).element; if(changeEffect) changeEffect.cancel(); changeEffect = new Effect.Highlight('changeNotification', {restoreColor:"transparent" }); }, onDrop: function(item) { var thing=Sortable.options(item).element.identify(); var anchors = document.getElementById(thing).childNodes.length-2; if(anchors > 20){ alert('This box had 20 creatures in it already, your last action has not been saved.'); window.location.reload(); } else{ new Ajax.Request("saveImageOrder.php", { method: "post", parameters: { data: Sortable.serialize("sortlist$box") } }); } } }); HERE; $box++; } ?> }); </script> if you solve this I'll send ya $10 via paypal I created a method for displaying an object's properties: Code: renderfunction = false; function showProperty (object, property) { document.write ('<td class="type">' + (typeof object[property]) + '</td>' + '<td class="name">' + property + '</td>'); document.writeln('<td class="value">' + ( (typeof object[property] != 'function') ? object[property] :( (property != 'showProperties') ? ( renderfunction ? object[property]() : ('<span class="self">NOT RENDERED</span>') ) : ('<span class="self">THIS</span>') ) ) + '</td>'); document.writeln('<td class="hasOwnProperty" >' + ( object.hasOwnProperty(property) ? "Local" : "Inherited" ) + '</td>'); if (typeof object[property] == 'function') { document.writeln ('<td class="function">' + object[property] + '</td>'); } else { document.writeln ('<td class="function"> </td>'); } } As long as renderfunction = false, the object is fine coming out of this function. However, if I change renderfunction to true, all my properties become undefined. Why isn't this working as I expect it to? How should I fix it? Thanks in advance, -Brian. Hi, I am using a script called osDate and I am trying to modify the sign up form to suit my setup. So far I have the below, but I would like to check a set ofradio buttons, but not sure, how to add it into the current code. var alphanumeric_chars = "0123456789.+-_#,/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ()_"; var alphanum_chars = "0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; var text_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz /'"; var full_chars = "0123456789.+-_#,/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz() _$+=;:?'"; <script type="text/javascript"> /* <![CDATA[ */ function validateme(form) { var tos_ok = form.accept_tos.checked; ErrorCount=0; ErrorMsg = new Array(); /* log details */ CheckFieldString("noblank",form.username,"Please enter the username."); CheckFieldString("alphanum",form.username,"Only letters, numbers and underscores '_' are allowed in the username."); CheckFieldString("noblank",form.email,"Email must be specified."); CheckFieldString("email",form.email,"Email address is not valid."); CheckFieldString("noblank",form.firstname,"First Name must be specified."); CheckFieldString("text",form.firstname,"Only letters are allowed in First Name."); CheckFieldString("noblank",form.lastname,"Last Name must be specified."); CheckFieldString("text",form.lastname,"Only letters are allowed in Last Name."); CheckFieldString("noblank",form.address1,"Last Name must be specified."); CheckFieldString("full",form.address1,"Only letters, numbers and underscores '_' are allowed in the password."); CheckFieldString("full",form.address2,"Only letters, numbers and underscores '_' are allowed in the password."); CheckFieldString("noblank",form.city,"Last Name must be specified."); CheckFieldString("text",form.city,"Only letters are allowed in Last Name."); if(form.username.value.length >= 5 && form.username.value.length <= 20){ if ( !isNaN(form.username.value.charAt(0)) ){ ErrorCount++; ErrorMsg[ErrorCount] = "Username must start with a letter." ; } }else{ ErrorCount++; ErrorMsg[ErrorCount] = "Number of characters in username should be between the specified range." ; } if (tos_ok != true) { ErrorCount++; ErrorMsg[ErrorCount]="Please read and accept the Terms of Service before registering"; } /* concat all error messages into one string */ result=""; if( ErrorCount > 0) { result = "---- Following errors occured -----"+ String.fromCharCode(13)+ String.fromCharCode(10); for( c in ErrorMsg) result += ErrorMsg[c]+ String.fromCharCode(13)+ String.fromCharCode(10)+ String.fromCharCode(10); alert(result); return false; } return true; } /* ]]> */ </script> Hey guys. I am using a javascript slideshow called fadeshow. (Main code below). I am wondering if there is a way to have thumbnail support, so I could allow the users to click on a thumbnail and have fadeshow go to that photo in the array. I have gotten a next / previous button working but also would like to add thumbnails. How would I write an a href link to specify an image in the array? Can this be done? Code: <script type="text/javascript"> var mygallery2=new fadeSlideShow({ wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow dimensions: [1000, 665], //width/height of gallery in pixels. Should reflect dimensions of largest image imagearray: [ ["images/1m.jpg"], ["images/2m.jpg"], ["images/3m.jpg"] ], displaymode: {type:'manual', pause:2500, cycles:0, wraparound:true}, persist: false, //remember last viewed slide and recall within same session? fadeduration: 500, //transition duration (milliseconds) descreveal: "always", togglerid: "fadeshow2toggler" }) </script> <div id="fadeshow2toggler"> <a href="#" class="next"><div id="fadeshow2"></div></a><!--allows clicking the photo for next--> <a href="#" class="prev">Previous</a> <a href="#" class="next">Next Image</a> ( <span class="status"></span> )</span> </div><!--end fadeshow2toggler--> <!--thumbnails i would like to work--> <a href= # ><img src="images/thumbnail1.jpg"></a> <a href= # ><img src="images/thumbnail2.jpg"></a> <a href= # ><img src="images/thumbnail3.jpg"></a> Any advice appreciated! Hello together! I generate html code with jsp. In that jsp there a several framesets and frames. And yes i know, frames are not really up to date but it's an old program and i have to deal with it now. Anyway, in the top frameset i have an onload attribute like onload="load()". In the function load i want to access the Element.prototype object. But unfortunately typeof Element gives me "undefined". So i looked a little deeper and found that window.toString() gives me "[object]" and not as expected "[object window]" so somehow my window doesn't know that its construcor is Window. window.construcor is "undefined" as well. And i don't have access to the Element object. I really don't know where the error could be. When the page is loaded and i access the same window over the console, then everything is right. But in my function a can't get access to the objects i need. I also don't know what part of the code could be useful to post here, but maybe someone had a similar problem before? i should say that this problem only occurs in IE8. In IE9 it works perfectly. Has anyone any idea?? Hi all, I'm stumped on finding a way in javascript to create an object factory whose instances are also object factories. In short I want something like that below, but no joy ... any clues? Code: function createClass () { return new createClass() function createClass() { return new createInstance () function createInstance () { //Default properties, values and methods which might later be extended } } } var createDoor = createClass(); var door1 = createDoor(); var door2 = createDoor(); var createChair = createClass(); var chair1 = createChair (); var chair2 = createChair (); Ignore post (if mod, please delete)
|