javascript

jQuery focus() sometimes not working in IE8

Hello. I am developing webapp using jQuery. I have functionality that adds new row of 3 input fields. After creating these DOM elements I want to focus one of input fields. I am doing it with calling jQuery focus() function on necessary input field. Problem is that calling focus() works fine in IE6 and FF3.5, but not working in IE8. I...

JavaScript getelementbyid problem

When we use getelementbyid in JS the browser ask to allow or block the script, is there a piece of script to automatically allow that or avoid that or is there an alternative for that ...

Manipulating jQuery draggables/droppables in script [UPD]

I want to append item to sortable list by script. Users can drag item to list directly, and can check some checkboxes and press "Send to list" button. First approach works, second is not. The problem is if I pass $(ui.draggable) to function, it works. But if i point to draggable element by jQuery chain ($(this).parent().parent().find('...

JavaScript OOP call function from other function

function MyClass(projectName) { this.projectName = projectName; } MyClass.prototype.createHttpRequestObject = function() { /* do something */ } MyClass.prototype.submit = function(message, script, line) { httpRequest = this.createHttpRequestObject(); } The error 'this.createHttpRequestObject is not a function' goes from line '...

looping through elements with jQuery based on name attribute rather than id

Thanks for taking the time to read this. I have an unknown number of (dynamically inserted) input elements in a form, to each of which I want to attach the datepicker widget included in jQuery UI. All of the input elements that I want to attach the datepicker to have a class of "date-pick". Obviously because we have more than one match...

Updating MySQL with textarea content without reloading

Hi, I'm building a page which loads the contents of our MySQL db for editing. Each row of the table is in a seperate, editable textarea on the page. I need the user to be able to update each row (ie send it's contents to the db) without reloading the whole page, with a click of a button that's responsible for that specific textarea. I u...

Creating new html in JS or ajax loading a html layout?

I have a page where I need to create a large amount of HTML that's not already present in the page. Using jQuery I've been building the page with JS piece by piece, adding divs here and there, etc, until I get my layout. Right now I'm thinking rather than do all that in JS, I can create the layout in a separate HTML file and then load ...

Modifying the String, Date and Number object in JavaScript

I'm working on a project which makes heavy use of extension methods to convert strings from the UI-layer into their appropriate object-types in the code-layer: (pseudo-code) // C# /* Converts a String from the UI-layer, formatted according to a user-defined UI-culture preference (in this case from da-DK) into a Double */ Double d = "1...

str.split() fails randomly?

this code fails randomly when input comes from specific sources, it works usually OK: var str = input; var lines = str.split("¤"); var map = {}; for(var i = 0; i < lines.length; i++) { var pieces = lines[i].split("="); map[pieces[0]] = pieces[1];} for example this input data does not create MAP at all, there is just one map entry: ...

Selenium doesn't register button press

Hey all, I have a problem running Selenium IDE over one of my AJAX pages. There is a HTML button with a javascript onclick submit that causes a new form element to appear once the button is clicked. The button also only appears through AJAX after a select value has been selected on a previously displayed drop down. Selenium sees the ...

Dynamic URL management with javascript

I have a search page which allows users to further filter thier results based on criteria within a certain set. You start a search by searching for all items within a "tag". The URL created for this would look like search/index?tag=TagA On the page there are a list of tags that are also in this result set. What I want is so in this...

Embedding WebView in UIView

Hi All, I'm trying to embed a WebView inside a UIView/TableView so as to implement the combobox. The WebView will have the select element , after the selection the value should be returned to the main UIView. I'm not sure how to implement this. In the ViewDidFinishLoad, I try to run the JavaScript like this: - (void)webViewDidFinishLoa...

jquery lost events

I would like to know if is there some jquery known behaviour that cause the lost of events handlers (in particular in iframes)? I've a strange kind of problem. I've built a webapp composed of two iframe. First i load content in the first iframe. I add some event event handler using jquery to first iframe content dom. Everything works....

Strange RequiredFieldValidator behaviour

I'm building a data entry screen that uses web services to update the db rather than the usual postback. However, I'd still like to use the AJAX validation classes to do my client side validation. Here's an edited version of what I've got so far: function ValidateData() { var res = Page_ClientValidate("Update"); if (res == tru...

Attaching and reattaching Event Handlers

Im using event handlers from a framework (prototype to be specific) to attach listerners to certain elements of a page like this: //html <a href="?default=1" class="default">Set Default</a> //js document.observe('dom:loaded', function(){ //get all elements with d 'default' classname for(i = 0;i < document.getElementsByCl...

How can I add a contact to Blackberry web application using JavaScript (if possible)?

I need to develop an application, which adds telephone numbers to existing or new contacts in Blackberry. The application is preferrably a web application. Is it possible to add and read contact information on Blacberry devices using JavaScript? If yes, a code sample would be appreciated. ...

Why can't you UnRegisterStartupScript??

Seems to me it is a bit wierd that you can do.. Page.ClientScript.RegisterStartupScript(this.GetType(), "KeyName", "alert('changed my mind')", true); And then later on you can't unregister or stop the javascript from being rendered programatically. Why would Microsoft do this? I don't like the work around here.. http://hemant-vikram...

Weird javascript

I 've got a very interesting thing with an html here. <html> <head> <script language="Javascript"> var str="me&myhtml"; function delimit(){ document.write(str); document.write("<hr>"); } </script> </head> <body onload="delimit()"> </body> </html> You see 'me&myhtml' with a line beneath. However, if you comment //document.write...

Re-running JQuery's selectors and actions after a programmatic insertion of new content.

Fellow JQuery hackers, hello :-) Suppose you have the following code: $('.links').click(function(){ //Do something } And I then insert dynamic content into a DIV's HTML content (Say, for example, after clicking a button, the new content gets inserted). This content has the "links" class. The problem is that the "click" button doe...

jQuery ajax data post problem

Hello, I've been searching to the answer for a while, I want to be able to parametrise my plugins AJAX values. So e.g. rather than: $.post('test.aspx', { name: 'bob' }, function(data){ .... }); I want to parametrise name and the value used in the post so e.g. var var1 = 'name'; var var2 = 'bob'; $.post('test.aspx', { var1: var2 }, f...