I have an object myscript and from within the method validate, i want to call the method init. so is there there anyway that I can call the method init without having to prefix like this: myscript.init();
This is the first time i'm really using javascript objects (well the first time i've written my own one) so the problem is probably a very simple one...
I've got this:
Code:
When i change the country from the dropdown box i get an error "hometown.setCities is not a function" but the thing is that i can call this in other ways eg from the address bar (javascript:hometown.setCities()) and it works perfectly.
I am trying to call a ActiveX object from JSP using the ActiveXObject method in javascript. I have a dll filed named Patchgenerator.dll which is registered and assigned a prog id "Patchgenerator.PatchGen.1" which is being passed as an argument to the ActiveXObject method. Below is the code i am trying to execute..
[Code]...
When i write the above code and save it as an html file it works fine..the activex object is created and the methods are called , but when i copy the same code to a file and save it as jsp file under webapps folder under tomcat it doesnt work and reports a javascript error with the error being: Automation server cant create the object at line : var SSOObj = new ActiveXObject("Patchgenerator.PatchGen.1");
Below I declared a basic object literal with 2 methods. The "doSomething" method is call from the "useDoSomething" method but the call is only sucessful if I use the "this" keyword or qualify the call with "SomeObj".
I am having a hard time getting the javascript file to run any of the functions after I've changed my original script to object literal format. Please tell me why it isn't working! I have attached a zip format of my code.
In an attempt to answer another question in this group, I've had to resort to calling the DOM method, Node.removeChild(), using a reference to it (long story...). That is, passing Node.removeChild.
In Opera (7.23/Win), the call appears to do nothing - the node remains - but no errors are shown. In Netscape (7.0/Win), an exception results[1]. On IE (6.0/Win), the node is removed.
Strangly, if I pass another function reference, say window.alert or a user-defined function, there is no problem. This illustrates the problem: Code:
I am trying some simple things with javascript and trying to use it in a object oriented way. However I am now facing a problem in which I can't access an object variable from an object method. I am using jQuery.
My code is as follows;
Code:
My problem is that the variable msg1 does not work when accessed from function called from the jQuery get function. I get the message undefined. Therefore I am wondering, is there a way how I can access msg1 of my object instance from the get function of jQuery?
I'm using the following code to refresh an iframe:
[Code]...
The problem is that Zenbox.show () gets called before the src attribute is fully loaded, so the refresh is visible to the user. Is there any way to setup a callback when the iframe.src is fully loaded that I can call Zenbox.show() in ?
I just got this script for a countdown on a website and I got it to work locally but when I upload it to the server i get the error "index.html:22 Uncaught TypeError: Object [object Object] has no method 'fancycountdown'".
I have checked to make sure all other javascript files are loading and they are and I can't figure out whats wrong. You can see it [URL]
I want to call C# method from jquery. So, I placed those methods in webservice and trying to call from jquery. But, it is giving an error as shown below: Access to restricted URI denied" code: "1012 This is seen from the Firebug console.
and addClickEvent sets the onclick attribute of above mentioned DIV. and in addClickEvent I am explicitely mentioning the name of class object. This means every time I create a Variable with another name I have to Change this function also.
I am using .each to find each form and attach validationEngine with it. When validationEngine success, i want object of calling/owner form. I am trying this, it is alerting that is is object. But i am not able to access "action" of form using this.action.
I'm having a lot of trouble understanding how to get my targeting working in IE. Let's say I have a <div id="test"> </div> with some form information in between. I use xmlhttpreq to process but I want the information after processing to appear inside the test div. I have it working perfectly with firefox but for the life of me I just can't get it to work with IE. I can only ouput to another DOM object.innerHTML and not the original.
Trying to figure out what was happening in a snippet in the jQuery docs. The snippet I refer to is here , documenting event objects.
The code:
Has me a tad confused. I know that e is an event object that calls keydown event for keycode 64 but what I am unsure of is how it is being triggered. There is no context to it, if you use .trigger() that way is the event called upon the loading of the object? If not when is .trigger() being called?
I'm trying to make a quick and dirty mp3 player that plays whatever mp3 is in the URL, for example [url] would open the SWF mp3 player (I chose this one for its simplicity[url]) and play that song. However, nothing I've tried works. Could someone take a look at my code ? Please note that downloading the mp3 through newwindow() works perfectly.
I'm working on a drag and drop HTML editor, in which blocks can be positioned. I need to build a controller which listens to mouse events and takes appropriate action (a state machine). The system is built using prototypes and objects. The Controller class looks like this (I removed some methods for simplification):
Code JavaScript: /** * Creates a controller for a document */ function Controller() {[code]....
The method 'handleMove' is entitled to handle a mouse move on the overlay. Because the 'this' keyword would not point to the Controller object I've written a wrapper according to the W3C EventListener interface (http://www.w3.org/TR/DOM-Level-2-Eve...-EventListener). This wrapper holds a reference to the object in which the method resides that's handling the event, so that the important 'document' attribute can be reached. This document holds the document that is being edited (it's of a custom type, and not to be confused with the document as in document.body)
The problem I now have is as follows. IE doesn't seem to be able to work with event handlers following the EventListener interface, but just functions. I need to get the object's reference there as well though, but this can't be done using an anonymous function, as at the moment it will be run it will be in a different scope, and not be able to reach the controller any more.Just using a global holding that reference variable, a method I used before, is not sufficient, as there may be multiple instances of the editor running on the same page.I have no problems in FFox, Opera, and Safari. Just IE because it uses an alternative event listener model.