javascript

How can I get returning data from jquery ajax request?

function isNewUsername(str){ var result; $.post('/api/isnewusername', {username:str}, function(data) { result = data.result; }, "json"); return result; } So , my problem is very simple but I can not figure it out . I want to access result from the isnewuserna...

nextSibling issue, again... sorry...

Ok, I am using insertRow to insert a TR element into a table, but for some reason it doesn't count that inserted TR element as a sibling of the others when I do nextSibling on it. For example, consider the following table. <table id="myTable"> <tr id="row_0"> <td colspan="3">Row 1</td> </tr> <tr id="tr_0_0"> ...

iPhone WebApp Question

I have this code- /** Save the web view as a screenshot. Currently only supports saving to the photo library. / - (void)saveScreenshot:(NSArray)arguments withDict:(NSDictionary*)options { CGRect screenRect = [[UIScreen mainScreen] bounds]; CGRect imageRect = CGRectMake(0, 0, CGRectGetWidth(screenRect), CGRectGetHeight(screenRec...

I'm having trouble traversing a newly appended DOM element with jQuery

I have a form that I want to be used to add entries. Once an entry is added, the original form should be reset to prepare it for the next entry, and the saved form should be duplicated prior to resetting and appended onto a div for 'storedEntries.' This much is working (for the most part), but Im having trouble accessing the newly crea...

Where to start to create an HTML website with 2 tables read from csv files using anything but php

I want to design a website which displays on loading two tables each with it's respective data from a csv file. Then every minute the website automatically refreshes. This problem seems so simple! But yet the solution eludes me. All of the files will be contained in 1 directory, not on a server but on a local machine. Such as sitting o...

Highlight search text in textarea

Hi to all, I have to highlight the search terms in the text area. I have one text Filed,search Button and text area. Quote ... After i have enter the search string in the text field whenever i click the search button it highlight the search terms which is available in the text area and focus the search term in text area. I have try ...

Needs help regarding print in asp.net (need to remove datetime from printpage)

i am using below code to print my content of webpage in asp.net using javascript window.print(document.getElementById('dvPrint')); when i do print, it automatically adds date time on page.. (i think because of page setup) in firefox. please tell me how can i remove this setting. i mean i dont want datetime to be printed automat...

How to hide first item from an Html Select Tag

I have the following code: <select> <option value="0">Option 0</option>. <option value="1">Option 1</option> <option value="2">Option 2</option> </select> When you click on select I wish the first item to be no longer listed. Also it must work on all browsers. How can this be done? Thanks. ...

javascript compare two DOM trees

I want to compare the change of a DOM node after a user event is fired on it; but I don't know on which element a user would fire, so my idea is to (1) save the DOM tree before an event and (2) compare the saved tree with the updated DOM tree when an event is fired. My question are (1) is there any better way? and (2) if there is no o...

Reference Object calling function in Javascript

I have a makeshift events system in JS and the attacher looks like this: events.attach(events.NEW_TASK,this.update); Where this.update is a callback/handler/function. The problem is, when the dispatcher tries to call this handler, it loses it's original context. How can I bind the handler with the context of the object that calls the ...

javascript resize background image

Is it possible to resize a background image on load using javascript? I don't care about dynamically resizing the image according to window size or anything, I just want to take large images and resize them to a specific width and height so that the full image fits inside a specific layout. WORK AROUND: I did what the people below sai...

How to validate a form with jQuery?

I tried to find the answer in other questions but actually nothing worked -.- Somehow I hate JavaScript ... Anyway! My Code looks like: function validate() { if ($(":input").length == 0) { $(":input").addClass("notvalid"); return false; } else { $(":input").removeClass("notvalid"); return true; } return true; } $(":in...

document.location Question

I need some help with document.location. Basically, I need a button, using document.location, with the URL hide://. Please help! Thanks! ...

Using jQuery to rapidly scroll through a countdown

I have a webpage that displays the number 0, and when the user presses "start", the number should rapidly increasing until it reaches a target number (maybe 10,000 or so) a few seconds later. I'd like the numbers to scroll by as if they're on a slot machine wheel. I've managed to mostly hack something together using the ScrollTo plugin...

Anyone know how to lock a website (HTML) to portrait orientation on iPhone with (HTML) meta tags, javascript, etc?

Does anyone know how to either lock Mobile Safari's orientation to portrait, or to block landscape (via javascript or otherwise)? In other words, I want the web page to remain in portrait mode regardless of the orientation of the device. ...

firefox and opera not compatible browser

Hello guys, Hopefully now I'm posting the right question :) In web application I'm using devexpress toolkit, and have the right (correct) result in IE only (using also some java-script), on clicking event for example is working in chrome and safari, but in Firefox and Opera not :( The grid view are not showed properly in division in any...

How Can I Know If An Input Is Checked If I Only Know His Value?

Hello here! I have a dynamic input in my php code like this one: <input type="checkbox" id="advantage[]" name="advantage[]" value="Special Option" /> And I need to know if it's checked... I can have multiple checks in the same format in the code, my brain hurts because i can't find a solution! Thanks 4 the help! ...

How to group rules in jquery

Hi I've got a simple question. I've this code below, i use ajax three times in very similiar ways the only things that change are the data passed and the id of the target. Is there a way to group these instructions in a simple one? Thx D. $('#fld_email').focusout(function() { var request_email = $(this).val(); ...

Pass through more then one argument with a Javascript .NET postback

I have implemented the javascript function that allows me to do a .NET (4.0) postback Javascript _doPostBack('_Page', argument) C# public void RaisePostBackEvent(string eventArgument) { //something happens } Is it possible to pass through more then one argument? ...

IE error on simple jQuery

Detaild information about the error Useraget: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Tiemstamp: Tue, 25 May 2010 08:54:11 UTC Message: Object doesn't support this proper...