How can I access the key of a non-associate array? Here's my scenario, I have an array of objects (in this case, they are coordinates):
coords[0] = {x: 37.543524, y: -56.65474}
coords[1] = {x: 35.041292, y: -76.03135}
//etc..
I'm using a jQuery templating plugin to print out the results:
$('#repeater').tmpl(coords).appendTo('body')...
Hi all,
How to obtain value of selected node of asp.net treeview from javascript?
I have tree:
<asp:TreeView ID="dtDivisions" runat="server" onclick="OnDivisionChecked(event);" ShowCheckBoxes="All" ShowLines="true">
</asp:TreeView>
I fill it using next method:
private static void BindTreeViewNode(TreeView control, TreeNode parentNo...
What general guidelines should I follow to degrade a JS-based web application gracefully? Are there such guidelines? Are there any public pages that make for good / bad examples? Are there any common pitfalls?
...
Hi. I have to check a string client side. If it contain only "\" (1, 2, or 1000 time) i need to refuse it. Code (with some of your suggestion that unfortunatly dont work):
value.replace(/\\/g, '');
if(value=="") alert("NO"); else alert("YES");
so :
value="\" = NO
value="\hello \people" = YES
value="\\\\hello \\people" = YES
value="he...
Hey Guys (and Ladies)
I want to select an image (with jQuery) by the src attribute. The Image is inside an ul and a collection of div's. The id of the ul is "sortable".
Here is my HTML:
<ul id="sortable">
<li id="pic_0">
<div class="sortEleWrapper">
<div class="imgWrapper">
<img src="/test1.jpg">
</div>
...
Hi,
I have a method in a class and into this method i have a handler for a click event in a div element:
function MyClass(container)
{
this.Container=container;
this.PrepareHandlers = function()
{
$('#Div1').click(function() {
alert(this.Container);
});
};
}
But since im into the handler, ...
I'm struggling to figure out how to re-index (?) a series of hidden fields with jQuery/Javascript. The sample code below is generated each time a user clicks a create button. The numerical value applied to the hidden fields within tier[] is the index of an option selected from a drop-down.
The problem I have is every block of code (exce...
I have some html that creates a dropdown list. The list has text values and text that is displayed to the user. I save some XML based on the “values” the user selects. At some other point in time I need to parse the XML and display the original text but not in the original list. At this point I only have the “value” from the list and not...
I am trying to use jQuery to handle the scroling, so I want to get rid of the browser's scroll bar... how do I do that?
...
I am trying to create an Enhanced Grid with nested sorting functionality in Dojo but when I go to add the nested sorting functionality via the plugins the grid no longer works (shows up) in the page. My enhanced grid creation code is as follows:
dojo.require("dojox.grid.EnhancedGrid");
dojo.require("dojox.grid.enhanced.plugins.NestedSo...
I'd like to take an image and turn the corners over to make a box (like a canvas painting)
i have gd library, imagemagick installed on the server and imagick php extension installed.
is it possible? any help appreciated
...
I have the following code in a view controller. "pageDisplay" is a UIWebView.
When I run the app in simulator, the HTML page comes up as it appears before the JS runs. The element with id "myHeader", an <h1> tag, is unchanged.
-(void) loadPageToView:(int)pageNumber{
NSString *path = [[NSBundle mainBundle] pathForResource:[NSString s...
I have an avaliable list of selectbox and I can't change the options. In Selectbox there are some disabled options but IE7 does not pay attention to the disabled property ;)
Which will be the best way to controll disabled options?
Thanks
...
hello ,
i use this jquery tabs plugin :
http://css-tricks.com/slot-machine-tabs/
it's work very good .. but i have problem with the columns contents .. the problem is that the a urls don't work in firefox .. firefox see urls inside it as normal text . not as urls , it's be not clickable .. so i don't know what is the cause of this pro...
Back in 2000 I had a js that let me get a very nice homepage:
one picture: <pic src=x>
and somehow the js changed the main picture every a predefined time period.
(there was a pictures pool that was loaded at pageload)
I can find such scripts now but cannot find one with fold effect
(like folding a page in a book)
The closet I got w...
Is there any function in Javascript for formatting number and strings ?
I am looking for a way for thousand separator for string or numbers...
(Like String.Format In c#)
...
Hello all,
I have two pages, The parent and from this page I am using:
window.open('OrderDetailsFull.aspx?ObjectID=' + ObjectID[1] , "TableDetails","status=0 , toolbar=0 , location=no , menubar=0 , scrollbars=yes , height=600px , width=800px");
to open a new window and manipulate data over there.
When i finish what i am doing i nee...
My intuition is that it's a good idea to encapsulate blocks of code in anonymous functions like this:
(function() {
var aVar;
aVar.func = function() { alert('ronk'); };
aVar.mem = 5;
})();
Because I'm not going to need aVar again, so I assume that the garbage collector will then delete aVar when it goes out of scope. Is this rig...
I have a div
div id='srch'
that has a computed height of 7000px how do i set the height of the another div to the same on window.load
div id='set_me'
...
Hello Friends,
I have a button something like this what should I do?
<input type="button" value="Exit" onclick="JavaScript:window.location.href='../index'"/>
On Exit I am going to Other view..
On click on Exit I need to display popup window saying Are you sure you want to Exit? with Ok and Cancel buttons
anybody tell me out to do ...