javascript

Javascript 2D array issue - all elements are a copy of the final entry

Hi there, I'm creating a javascript 2D array from an XML file which I then manipulate and filter as necessary before displaying on the page. As I loop through the XML records, I manipulate the data a little, build a normal array from it (rowRecord) and then add this array to the 2D array (dataSet). Thing is, I end up with a nice 2D arr...

[iPhone Web App] Ignoring Orientation

Hi, I am building a web application for iPhone. Since the application shows different content while in different orientations, the built-in animation between the two orientations animates the original content as well. For better result, I would like to disable the animation between the portrait and landscape. Is there a way to do it fo...

Get function name in javascript

Hello, Does anyone know if there is a way to get javascript function name. For example I got a function like function test1(){ alert(1); } I have it in my head section. Then I create an object obj1 and put my function there obj1.func = test1; When I call a method in obj1 object, do I have any way to get my function name (test1) i...

how can i show tree nodes in lower level?

using jstree 1.0 ,how can I exhibit the child nodes in lower level than the parent? when I click on the parent, I expect to see children in a place after parent,that I can diagnose the parent and its children, but they are all shown in the same level. which property should I set??? i have this problem by using both data and ajax in jso...

javascript anonymous function scope

I have the following anonymous function: (function() { var a = 1; var b = 2; function f1() { } function f2() { } // this => window object! // externalFunction(this); })(); function externalFunction(pointer) { // pointer.f1(); => fail! } I need to call external function from this anonymous function and pass it's pointer to...

How do I set the default content in the 'additional comments' box on the post_bug.cgi page in Bugzilla based on the status of the bug?

I have been able to set the default content in this box, but now I need the content to be able to change as the user changes the status of the bug i.e. if the bug is resolved I want to add specific instructions in the box as to what information is requested, if the bug is being closed I want to add a different set of instructions. Anyone...

How to make two JSF selectOneMenu that depend on each other?

I have two instances of selectOneMenu, one dependent on the other. But my processValueChange in the bean is never invoked. JSP portion: <h:selectOneMenu id="slaPeriod" onchange="submit()" required="true"> <f:selectItems value="#{LoginForm.periodList}"/> <f:valueChangeListener type="form.LoginForm" /> </h:selectOneMenu> I want to ...

Facebook extended permissions from canvas application

I'm create a Facebook canvas application that will be require extended permissions, for both images (creating galleries, and uploading images) and posting to a users news feed. I'm having trouble with extended permissions. What is the correct way to do this through Javascript or PHP? ...

clear input boxes on button click with javascript

hi... I've a program which creates text input boxes dynamically. I want to clear the contents of the boxes on the click of clear button. var elems = document.getElementsByClassName(CLId); var myLength = elems.length; var total = 0; for (var i = 0; i < myLength; ++i) { if(elems[i].value != null && elems[i].value > 0){ var el = el...

How to check the browser version and chanage the css

hello , i have created an web page and it works fine in firefox,opera etc and fails in internet explorer 6 so i need to check the version of the internet explorer and change the css code... please help me how to do that ...

Changing sth. with Javascript(using Gm and jQuery)in the website when an option is selected

Hello everybody, I'm writing another Greasemonkeyscript with javascript using jQuery and -"tamtam"- there was a question comming up to my mind. There is a button on the page I have no access to. By clicking it, you can choose between four options.Option 2 is preselected. <select id="idname" name="namename"> <option>Option1</option>...

how to make the menu close if it is clicked out

i have an menu with some values and i got someting hidden and while click on more button it shows like google more menu... if it is clicked out it is not hiding till the more menu is clicked once again <a href="javascript:;" onClick="toggle('one');">More<small>▼</small></a><div class="more list" id="one" style="display:none"><a href="#"...

Whats the best practices to let flash files communicate with my website?

I am working on a website and this website contains games and this games will need to submit score to the website so the website will handle saving the user game score in the database. So i am asking about the standards and common techniques to do this communications between the website and the flash games, is it better to let the fl...

In GWT how to know all the styles applied to a given element (by id or class name)

I have the following problem : in my GWT project there is a "main" css file for the application, inline css in the DOM that come from the application computation and a css file that is bundled in an archive uploaded to the application and dynamically loaded. Now I need for an Element to find which CSS rules are applied, coming from eith...

design changes with browser

Possible Duplicate: HTML and JavaScript Having problem in display in different browsers. It is showing great in IE8, but not in firefox. What i want to do is that, a) I want to change the display box with pressing on colored headers. b) when will I press dark green header in table, it should display "registration status", c) w...

How can i use js files in master pages?

i have a master page. i try to add js files. vs editor is not draw green color. But no affect my pages with js. i can not use below js. How can i write src? (i can use pickurl) but i don't see effects of js on page <script src="Engineering/EngDynamicsCreationExcel/EngJs/jquery-1.3.2.min.js" type="text/javascript"></script> <script src=...

The use of globle in regular expression.

I used the regular expression (/\<+\/+\s+/gm,"</"). If i remove the g the regular expression don't work. Please let me know technical difference between 'g-global and m-multiple'. ...

ServerTags don't work in OnClientClick

<asp:button runat="server" Text="Save as" OnClick="btnSave_click" OnClientClick="if(!Check('<% # tb.ClientID %>')) return false; return Object();" CausesValidation="false"></asp:button> <asp:TextBox runat="server" ID="tb"></asp:TextBox> Server tags don't work here. I spend a 1-2 hours to find some way to make this work, but i didn't...

javascript get function body

Hello, I have a function e.g. var test = function () {alert(1);} How can I get the body of this function? I assume that the only way is to parse the result of test.toString() method, but is there any other way? If parsing is the only way, what will be the regex to get to body? (help with the regex is extremly needed, because I am not...

Object property always undefined

This is the first time I've used JS objects and I'm confused as to why this property is always undefined: function Rotator() { this.interval = 300; this.image = 0; this.images = undefined; } Rotator.prototype.Fetch = function(links) { console.log("Fetch called"); this.images = links; } Rotator.prototype.Current = f...