I have an object that defines the default color, and then when the color is updated, the different css classes need to be updated as well. So here's what I was trying to do
So problem 1 is I keep getting "undefined" returned for "this.mainColor". If I use colorPicker.mainColor, it hasn't been created yet so it throws an error.Problem two is if I update mainColor from another function, say to make mainColor = "green", then backgroundColor doesn't automatically update.
I'm writing a program that involves a network of interconnected nodes (or simply objects in my example below). It depends on being able to access properties of an object's linked objects (a bit oddly worded, sorry)...Problem is I'm not sure how to properly access those properties... see below please.
<script> //This is an example of a problem im having in my own code... //I want to access the name of the object within the links array wintin the object...
I have 4 checkboxes in my form and wanna change the number (to be displayed) according to the selection made on the ListBox Menu
HTML PART of the code
<select name= "rights" onChange="chk_Count(this);"> <option value = 0 > Admin </option> <option value = 1> guest </option> </select>
<input type= "checkbox" name = "add" value = "on"> <input type= "checkbox" name = "edit" value = "on"> <input type= "checkbox" name = "delete" value = "on"> <input type= "checkbox" name = "view" value = "on">
I want that when I select Guest onle checkboxes for "ADD" n "VIEW" should be shown and when Admin is selected all four. but I am able to find out how to access those elements in the form and change their properties.
I have a dynamically generated table, filled from a database by a perl application.
Each row represents a database record and has a 'status' and a unique 'id'.
What I want to do is create buttons to hide all rows with a particular status. The code to show/hide is relatively easy, but how do I turn them all off at once?
Several ideas I had:
1. Set the tr's 'id' attribute to the status (eg 'open') and then set that id to display: none. But that only turns off the first one.
2. Do the same but somehow loop over all elements looking for that id.
3. Set the tr's 'id' attribute to the status plus the data's id (eg 'open.24') then loop over all elements matching the status with a regexp.
4. Doing something else that I haven't thought of yet.
I have a javascript function that needs to access methods of a java object(localTag). In my JSP I'm trying to include hidden fields for the Strings returned from the getter method calls of the object like so:
If I can do something like this, what is the correct syntax and how do I access this property in my javascript? When I have a hidden field that is just a String, I access it in the javascript like "document.getElementById("theString").value" and it works fine, but I can't seem to find how to access the String value of a method call.
What it is supposed to do is pull down the background image of my nav panel by setting the CSS height to match the length of the page. I got it to work in IE but it does not work in Opera or Firefox. I'm not sure how to access the correct object in Opera and FF.
To view the problem:
Well, I'm a new user so I can't post the link to the problem.
I am fairly familiar with the concept of Objects and their properties and methods, but javascript being object based as opposed to object oriented has me stumped on how to access an object's properties from an onclick event handler created for another object created within the original object.In the example below, I have a constructor function called anyObj. to which I pass an object reference to an element.
anyObj has 3 properties and one function increaseWidth()
increaseWidth() creates a new button with an onclick event handler and this is where I have a problem.The onclick function needs to increase the value of anyObj's this.width property. I originally had a line this.width += 10; in the onclick but quickly realised why this wasn't working because the this in the onclick function refers to the new button object and not the this.width property of anyObj.
The workaround I have used, and it works, is to make a copy of all the this.xxxxx properties. eg. width = this.width; and use the width variable in the onclick as you can see below. This "workaround" works fine but doesn't feel ideal to me.So, what I am asking advice on is, is there a better way to access the anyObj()'s properties from within the onclick function than the way I have done it? Obviously I would prefer to not have to make copies of all the anyObj() properties like I have to make them accessible to the onclick function.
Code:
function anyObj(divObj){ this.elem = divObj; this.width = 50;
I'm trying to create a list that contains items which are filters for a search. The list shows 10 items (max) on the page load. if there are more than 10 it changes the class of the elements > 10 so they are hidden, and a 'show more' link is appended. Now if the user has 'unhidden' the previously hidden items and then chooses one, I want the class for all those previously hidden items to change until the user has deselected that item.
[Code]...
Is there a better, smaller way to write this? It works for what i need currently, but there are future features im planning that will not be practical checkingindividualindexes the way i've done it.
I'm a little puzzled over the possibility of accessing an array. I've declared the previd id - in the proxy.invoke call which works just fine (we have already implemented an .each loop which also works. My problem is this - after accessing the proxy.invoke function, the previd is populated correctly with push but after the call, we cannot seem to access the previd array to make a join to a string. Here's the basics of the code.
var previd = []; proxy.invoke("validdateIDCard", p_caregiverid, function(validaterID) { var valcard = validateID; previd.push(valcard); }, onPageError); var finalvalue = previd.join("|"); <-- this is where the problem lies - cannot seem to read the variable...
I have an object whose name is mural. I have assigned the name mural to the title of an anchor element. When user clicks and element I want to store the title of the anchor in a variable called sprite. I then want to access that object whose name corresponds to the sprite variable string.
Here is my code: HTML Code: var mural= new Object(); mural.top='0px'; mural.left=-'510px';
var stamps= new Object(); stamps.top='0px'; stamps.left=-'1886px'; var sprite=$(this).attr('title'); $(".image-holder").css("background-position",'sprite.top, sprite.left');
It's not working because the the variable sprite is just a reference to $(this).attr('title'), how do I make it reference the object? Oh and I know that .cc jquery statement probably wont work, I'm not sure yet of the correct way to have two values that don't need quotations in as the second argument.
The below code posts a couple of vars to a php file which sends back a json object containing (in the test case) one object called 'faves' with 2 variables (let's say called var1 and var2). I can't seem to access the variables after the ajax call. The result is always an 'undefined' error message. I've tried:
I got two ASP pages. One is ASP email form (I'm using Persist ASP Email component). Another one has all file links in it. For example, when user click Outlook course hyperlink. It will pop up another window with outlook course PDF file. (All PDF files are already in the server).
What I am trying to do is: When user click the "Add Email" hyperlink, it will add that course name and filepath into ASP/VBScript Dictioanry Object. After the user finish and click "Attach to email" button. All the files will be attached in the email as an attachment.
Because I am not familar with VBScript. So, can Javascript add items to ASP Dictionary Object?
The scenario is of two different web servers. The parent frame (html page orginates from server 1) has script like function x1() { ..... alert('parent invoked'); .... }
Inside child frame (html orginates from server 2) the html refers to parent script like { ..... parent.x1(); .... }
It throws Microsoft Jscript runtime error: permission denied. I am using IE based on WinCE 4.2 version platform.
I have an object on the document element that allows for other components to register with it, i have a custom event something along$(document).bind("register",function(thechild)..So in the child object when they are created i call$(document).trigger("register",this);And indeed i get the DOM object. However i'm looking for the plug in object, i want to be able to call methods on the passed childobject and access it's Config.Does that make sense? How can i write a plug in that is applied to various objects that also registers itself with an 'overseer' object on the document element in such a way that i can allow that overseer object to call methods on any registered child objects?
I'm getting strange error "Object doesn't support this property or method" while accessing the application recently. The same code I am using since long time. The below code is written in java class:
I'm using FancyUpload (it runs on MooTools) for a section of my website. It automatically gets the <form action=""> URL of where it should send to with
HTML Code: url: $('form').action
I'm trying to have a drop-down list so that whenever something else is chosen, the URL of which this is submitted to, changes.I know this:
HTML Code: <select onChange="document.forms[0].action = '/upload/?section=' + this.options[this.selectedIndex].value;">, but this, of course, doesn't change anything in the uploader.
How would I change the URL of the uploader? I really don't know how I would, since this is how the JavaScript starts:
HTML Code: window.addEvent('domready', function() { // wait for the content
Goal: From window A, I want to manipulate the DOM of window B, where window B is the result of calling window.open(). My attempts are shown below, but Window B is never updated. winRef = window.open("","Window B"); Try 1: $(winRef).find("body").append("<div id=container>mr container</div>"); Try 2: $(winRef).find("body").html("<div id=container>mr container</div>"); Try 3: $(winRef.document.body).append("<div id=container>mr container</ div>"); Try 4: $(winRef.document.body).html("<div id=container>mr container</div>"); The jQuery Core doc [URL] claims that it can wrap a window object. Browser is FF2.0