javascript

How can I send parameters to VB.NET method from JavaScript code?

I have vb.net method and i call it from JS code i can't send parameter to this method and here is sample: JS Code : function OnSave() { var sign = document.FORM1.SigPlus1.Signature(); <%Save(sign) %> } VB method : Public Sub Save(ByVal obj As Object) Dim obj1 As New PFSIGNATURELib.SigniShellSignature ...

Problem with eval function

Hello I get a weird error in this code: function validateForm(aform) { var s=""; //check if form has validator arr if (aform.validatorArr) { //Iterate over Form elements for (var i=0;i<aform.validatorArr.length;i++) { eval("var anelem=document.forms."+aform.name+"."+aform.validatorArr[i][1]); var pattern=ge...

Radiobutton validation.

The question is on the client side validation using java script. Significant parts of the program related to the question are given below.. ... <form name="results" action="" method="post"> ... <input type="radio" name="id" value="<%= id_edit %>" /> <!-- Don't bother about id_edit --> .... <input type="button" name="Edit" value="Edit" ...

Sqlserver2008 & Virtual Earth

Hi All, I am using sqlserver2008 to display information on top of virtual earth.I have written one genericHandler to retrieve data from Sqlserver2008.I am calling handler through javascript.The problem here is when i run handler through broser it is giving me coorect feed.But when i try to load call from javascript i am getting the erro...

AJAX POST and Plus Sign ( + ) -- How to Encode?

I'm POSTing the contents of a form field via AJAX to a PHP script and using Javascript encode(field_contents). The problem is that any plus signs are being stripped out and replaced by spaces. How can I safely 'encode' the plus sign and then appropriately 'decode' it on the PHP side? ...

Access methods and properties of arbitrary Objective-C object from JavaScript.

I want to access properties and call methods of an Objective-C object that was returned to JavaScript host as property of exposed object ([windowScriptObject setValue:self forKey:@"a"]): - (id) valueForUndefinedKey:(NSString*) key { if ( [key isEqualToString:@"b"] ) { MyObject* obj = [ [ MyObject alloc ] init ]; return obj; ...

WebForms, AJAX and prompt popups elegantly

I have a web site already developed with tons of updatePanels, buttons, and integrated functionality. I have to add some confirmation prompts, these prompts should be customized, and have options like 'Continue', 'Cancel' . This is a possible scenario: The user writes something in one textbox, and then clicks a submit button. The Promp...

What does this refer to in an onfilterchange attribute?

I've taken code from the MSDN page on Matrix Filters and modified it slightly. The functions all expect an input variable oObj which gets passed in originally from the onfilterchange: <DIV ID="oDiv" STYLE="position:absolute; filter:progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand')" onfilterchange="fnSpin(this)" > ...

What is the consequence of not using a key with google ajax api load

I can call the google api this way with a key : <script src="http://www.google.com/jsapi?key=ABQIAAAA1XbMiDxx_BTCY2_FkPh06RRaGTYH6UMl8mADNa0YKuWNNa8VNxQEerTAUcfkyrr6OwBovxn7TDAH5Q"&gt;&lt;/script&gt; But i can also omit to specify a key like this: <script src="http://www.google.com/jsapi"&gt;&lt;/script&gt; and my code still work. ...

Jquery attribute selector

I have a variable (div element) which contains some table html. I can use this javascript to add a class to each cell that has a background set. var tds = tempDiv.getElementsByTagName("TD"); for (var j = 0; j < tds.length; j++) { var oTd = tds[j]; if (oTd.style.background.length > 0) { oTd.className = 'faketh'; ...

Threading using AJAX

When the user clicks on a link to generate report I make an AJAX call which generates a pdf file in the background.Now the files are huge running upto 10mb or more.So it takes some time.In the mean time the user should be able to navigate other links as if nothing has happened.So I need to implement in such a way that the pdf generation ...

How to expand JavaScript Array with another Array?

There doesn't seem to be a way to expand a JavaScript Array with another Array, i.e. to emulate Python's extend method. What I want to achieve is the following: >>> a = [1, 2] [1, 2] >>> b = [3, 4, 5] [3, 4, 5] >>> SOMETHING HERE >>> a [1, 2, 3, 4, 5] I know there's a a.concat(b) method, but it creates a new array instead of simply e...

jQuery Mind Map/Think Map

Hi all, I was wondering if anyone happens to know of a jQuery (or pure javascript) mind map. I found this one a few times, but it uses MooTools, unfortunately. ...

Remove divs after 20 using jQuery

Hello, Divs of class=message are generated using a post which pulls data and puts it in the page. Now, I want to remove the lower divs after it reaches 20 <div class="message">test</div> <div class="message">test</div> <div class="message">test</div> . . . <div class="message">test</div> So i need a sort of function to remove the rem...

Ip to country, city, lat, lang javascript service

What the best/accurate/free service to convert the IP from the following script to country/city/lat/long? $.getJSON("http://jsonip.appspot.com?callback=?", function(data){ alert( "Data Returned: " + data.ip); }); ...

jquery Sortable/Selectable: filtering child controls

I have a div containing nested divs, like so: <div id="tree" class="tree"> <div class="node"><div class="handle"></div>Node 1<div class="ignore"></div> <div class="node"><div class="handle"></div>Node 2<div class="ignore"></div> <div class="node"><div class="handle"></div>Node 3<div class="ignore"></div> </div> Then, to add sortable()...

How to set selected item in dropdown list using jQuery

Hi all I'm using the following jQuery function to populate a dropdown list. Once the user selects an item I am storing the selected value in a session variable and Im able to get the data back from the session variable via a hidden filed in to a variable (selectedApp) after a postback. The problem is that after a postback I am not able ...

Need Javascript Regex Replace to wrap certains words with <a...>

We have a database where every table name starts with WW. I want to display an SQL on a web page, but wrap each table name with a link. For example: "select * from wwx_something where ..." Should be transformed into: "select * from <a href='/table/wwx_something/'>wwx_something</a> where ..." There might be several tables, of course...

error on getAttribute while parsing an xml document in Internet Explorer

Hi All, I'm calling a webservice from javascript and then parsing the xml and rendering tables. All is well in firefox, but in IE its a different story. The problem seems to be on this this line var count = result.childNodes[0].getAttribute('Count'); Is there an IE friendly way to get an xml attribute in javascript? the rest of th...

rails rjs replacement and swap values

I'm trying to figure out how to use RJS to swap between two fields... i know how to replace the values but I can't seem to figure out how to read it. Is it not possible to read values thru RJS? Only to replace? <%= link_to_function "Swap" do |page| #to_value = page[:currency_to].value page[:currency_from].value = to_value...