[jQuery] Define functions before DOM loads

2009-02-18 Thread JQueryProgrammer
How can we define functions even before the DOM loads fully. I tried like (function() { msg = function() { alert(Hello User); } }); $(function() { msg(); }); This is just an example. But it gives me Object Expected error. Please let me know how to do it.

[jQuery] Re: Define functions before DOM loads

2009-02-18 Thread JQueryProgrammer
Got it. I need to define as (function() { msg = function() { alert(Hello User); } })(); Thats it. On Feb 19, 11:08 am, JQueryProgrammer jain.ashis...@gmail.com wrote: How can we define functions even before the DOM loads fully. I tried like (function

[jQuery] Optimized Function to transfer Array to Listbox

2009-02-05 Thread JQueryProgrammer
I have two array of items containing the values and text to be inserted in a Listbox. I had written the function as: array2Listbox = function(objListBox, arrValue, arrText) { var oNewOption; return jQuery.each(arrValue, function(i) { oNewOption = new

[jQuery] JSON with .Net

2009-01-22 Thread JQueryProgrammer
I am trying to use JSON with jquery and .Net. I am using json2.js for JavaScript and Newtonsoft.JSON for .Net serialization. Here goes my code: JavaScript --- $.ajax({ url: http://localhost/JSONSample/default.aspx;,

[jQuery] jQuery.support query

2009-01-16 Thread JQueryProgrammer
The utilities jQuery.browser and jQuery.version has been deprecated in jQuery 1.3 version and the documentation says to use jQuery.support for the same. But I do not find any options for browser and version in jQuery.support. Although they have been included in 1.3 release too, but are

[jQuery] Re: Select all controls of the form

2009-01-13 Thread JQueryProgrammer
karl.r...@gmail.com wrote: Errr img elements aren't form controls. input type=image elements are but :input selects those. I'm not sure what you mean. Karl Rudd On Tue, Jan 13, 2009 at 5:43 PM, JQueryProgrammer jain.ashis...@gmail.com wrote: The above code selects all the controls except

[jQuery] Select all controls of the form

2009-01-12 Thread JQueryProgrammer
I am trying to validate all the controls that exist in the form. My form code looks like: form id=form1 input type=text id=txt1 name=txt1 / br/ textarea name=txtArea id=txtArea cols=100 rows=4 / br/ select id=sel1 name=sel1 style=width: 250px;

[jQuery] Re: Select all controls of the form

2009-01-12 Thread JQueryProgrammer
, Jan 13, 2009 at 5:16 PM, JQueryProgrammer jain.ashis...@gmail.com wrote: I am trying to validate all the controls that exist in the form. My form code looks like: form id=form1        input type=text id=txt1 name=txt1 /        br/        textarea name=txtArea id=txtArea cols=100 rows=4

[jQuery] Window.Open code

2009-01-02 Thread JQueryProgrammer
I am trying to write a code for window.open in jQuery. here is my code: OpenNewWindow = function(strURL, winName, options) { this._settings = $.extend({ toolbar: no, location: no, directories: no, status: no,

[jQuery] Re: HttpHandler not returning JSON data

2008-12-29 Thread JQueryProgrammer
/pages/json-net.aspx On Dec 28, 1:15 am, JQueryProgrammer jain.ashis...@gmail.com wrote: I got the solution to this. Actually this code was working in Firefox and not in IE. When I tried to run in IE, it was giving error 12030 (Server unexpectedly terminated connection) from IE's

[jQuery] $.getJSON not returning specified count

2008-12-29 Thread JQueryProgrammer
Hi, I was trying to get 10 items from the json file. My url in $.getJSON looks like: $.getJSON(myjsonfile.json?count=10, {}, function(data) { $.each(data, function(i, item) { alert(item.title); alert(i); }); }); But the above code returns all 20 items from my file.

[jQuery] Re: $.getJSON not returning specified count

2008-12-29 Thread JQueryProgrammer
It contains all items from my json file. The file looks like: [ {title:Title1}, {title:Title2}, {title:Title3}, ... ... {title:Title20} ] On Dec 29, 4:55 pm, MorningZ morni...@gmail.com wrote: What's the returned JSON look like? On Dec 29, 6:50 am, JQueryProgrammer

[jQuery] Re: jQuery.getJSON Current Url Prefixed

2008-12-29 Thread JQueryProgrammer
Is your http://remoteServer page a json file or is it returning a json data? buaziz wrote: hi am using jQuery.getJSON to request a cross-domain page using the following code jQuery.getJSON(crossDomainUrl, function(result) { processResult(result); }); but i never reach the

[jQuery] Re: jQuery.getJSON Current Url Prefixed

2008-12-29 Thread JQueryProgrammer
Can u paste the remote server url over here. I will try from my local m/c. I tried the sample given on http://docs.jquery.com /Ajax/jQuery.getJSON#urldatacallback and it works perfectly fine. On Dec 29, 6:34 pm, buaziz bua...@gmail.com wrote: the remoteServer is returning JSON data. -- View

[jQuery] Re: jQuery.getJSON Current Url Prefixed

2008-12-29 Thread JQueryProgrammer
Try this code: $.getJSON(http://www.panoramio.com/map/get_panoramas.php? order=popularityset=publicfrom=0to=20minx=-180miny=-90maxx=180maxy=90size=mediumcallback=?, {}, function(data) { $(data).each(function(i, item) { alert($(this)[0].photos[i].photo_id); })

[jQuery] jQuery ajax Samples

2008-12-27 Thread JQueryProgrammer
Hi All, I was wondering whether I could find any good basic examples for $.ajax where I could find how to use the options of the $.ajax. I wanted to see how we can use the dataType: 'xml' / 'json' / 'html' etc options to capture respective data and use them. docs.jquery.com provides very basic

[jQuery] HttpHandler not returning JSON data

2008-12-27 Thread JQueryProgrammer
Hi All, I was working with a basic example where I wanted to get JSON data from the HttpHandler. My javascript code looks like: $.ajax({ url: 'Handler1.ashx', type: 'POST', data: { name: 'MyName' }, contextType: 'application/json; charset=utf-8', dataType: 'json',

[jQuery] Re: AJAX with IE and method POST

2008-12-27 Thread JQueryProgrammer
Thanks a ton George. You saved my day. I have been trying to getting this issue and was searching for a solution. Your post helped. On Nov 15, 1:29 am, George gev @comcast.net wrote: No i did not...I did pass exactly this '{}' (empty JSON data). As i said the problem was that i were not

[jQuery] Re: HttpHandler not returning JSON data

2008-12-27 Thread JQueryProgrammer
stream the input stream must be completely read by the server (even if you are not interested in it). On Dec 28, 10:29 am, JQueryProgrammer jain.ashis...@gmail.com wrote: Hi All, I was working with a basic example where I wanted to get JSON data from the HttpHandler. My javascript code looks

[jQuery] Re: Error getting value from server

2008-12-10 Thread JQueryProgrammer
looking for trouble. On Wed, Dec 10, 2008 at 12:34 AM, JQueryProgrammer [EMAIL PROTECTED] wrote: I am migrating my existing ASP application javascript code to jquery. However places where i want to get the value from server, I am getting an error like: var myvalue = %= myservervalue

[jQuery] Re: pleeease heeelp me nowwwwww

2008-12-10 Thread JQueryProgrammer
Try this: $(function() { // your code goes here. }); Also while including the jquery file, write it as: script type=text/javascript src=jquery.js/script Check whether this helps. On Dec 10, 2:17 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: hi i have written jquery for a site; after

[jQuery] Re: Top 5 Movies of the Box Office Watch Online

2008-12-10 Thread JQueryProgrammer
Stop spamming the group with such posts. This is irrelevant here. On Dec 11, 7:27 am, 24 Hrs Movies [EMAIL PROTECTED] wrote:     Top 5 Movies of the Box Office http://newmegamovies.blogspot.com/   1. Four Christmases  Reese Witherspoon, Vince Vaughn, Mary Steenburgen  2. Twilight  Kristen

[jQuery] Select option value not working

2008-12-09 Thread JQueryProgrammer
$(input[name='myselect'] option:selected).val(); is not working. It gives undefined. Can anyone please help.

[jQuery] Image.css(display) not working

2008-12-09 Thread JQueryProgrammer
image id=myimage myimgid=myimageid src=baloon.jpg / I want to check the style display for this image. I am doing as: $(image[myimgid='myimageid']).css(display); but its coming undefined. I cannot check it with id as my id is getting runtime generated. Please help.

[jQuery] Re: Select option value not working

2008-12-09 Thread JQueryProgrammer
you want:    $(input[name='myselect']).val() The only time you need to check is individual OPTIONs are selected is if you have a multi-select list box. Karl Rudd On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer [EMAIL PROTECTED] wrote: $(input[name='myselect'] option:selected).val

[jQuery] Re: Select option value not working

2008-12-09 Thread JQueryProgrammer
that I have attached as: $(input[value='GO']).click(function(event) { event.preventDefault(); alert(Default Event Cancelled); }); But still its not canceling the default event. On Dec 9, 3:32 pm, JQueryProgrammer [EMAIL PROTECTED] wrote: Great. Thanks. lso is it possible to select

[jQuery] Re: Image.css(display) not working

2008-12-09 Thread JQueryProgrammer
, 7:16 am, JQueryProgrammer [EMAIL PROTECTED] wrote: image id=myimage myimgid=myimageid src=baloon.jpg / I want to check the style display for this image. I am doing as: $(image[myimgid='myimageid']).css(display); but its coming undefined. I cannot check it with id as my id is getting

[jQuery] Error getting value from server

2008-12-09 Thread JQueryProgrammer
I am migrating my existing ASP application javascript code to jquery. However places where i want to get the value from server, I am getting an error like: var myvalue = %= myservervalue%; when i check in myvalue, it is populated with %= myservervalue% as string. If I try to remove then it

[jQuery] %= myvarvalue % not working. Urgent. Please help

2008-12-09 Thread JQueryProgrammer
I am net able to access my ASP server side constant value in jquery file. I am trying as: var myvar = %= myvarvalue %; but when i put an alert on myvar, it shows %= myvarvalue % and not the value of myvarvalue. Can anyone pls help. Its really urgent. Thanks in advance

[jQuery] Re: %= myvarvalue % not working. Urgent. Please help

2008-12-09 Thread JQueryProgrammer
js file. On Dec 10, 11:50 am, JQueryProgrammer [EMAIL PROTECTED] wrote: I am net able to access my ASP server side constant value in jquery file. I am trying as: var myvar = %= myvarvalue %; but when i put an alert on myvar, it shows %= myvarvalue % and not the value of myvarvalue. Can

[jQuery] Type of Control

2008-12-08 Thread JQueryProgrammer
How can I check what is the type of control. eg. In javascript document.getElementById(mycontrolid).type will return select-one, textbox, checkbox, radio etc. How can I find it in jQuery. I tried as $(#mycontrolid).constructor but it returns as Object in all cases.

[jQuery] Re: Type of Control

2008-12-08 Thread JQueryProgrammer
:34 AM, JQueryProgrammer [EMAIL PROTECTED]wrote: Thanks for the help. On Dec 8, 3:28 pm, Kayhadrin [EMAIL PROTECTED] wrote: If you try $(#mycontrolid).attr('type'), you should find the type of INPUT tag you have. On Dec 8, 9:05 pm, JQueryProgrammer [EMAIL PROTECTED] wrote: How

[jQuery] Re: Type of Control

2008-12-08 Thread JQueryProgrammer
Thanks for the help. On Dec 8, 3:28 pm, Kayhadrin [EMAIL PROTECTED] wrote: If you try $(#mycontrolid).attr('type'), you should find the type of INPUT tag you have. On Dec 8, 9:05 pm, JQueryProgrammer [EMAIL PROTECTED] wrote: How can I check what is the type of control. eg

[jQuery] Generic Handler returning JSON

2008-11-30 Thread JQueryProgrammer
Hi All, I am trying to get data back from the server by passing JSON values from jQuery. Find below my code: $(#btn).click(function() { $.ajax({ url: http://; + location.host + /AJAXSample/ GenericHandler.ashx, data: {name: 'Ted'}, type: GET, dataType: json,

[jQuery] Re: jQuery select all vs conventional javascript

2008-11-20 Thread JQueryProgrammer
. -Mike From: JQueryProgrammer I have been using jQuery for quite some time now. For one of my projects, I needed to select all the options in the listbox which were 10,000+. I tried to do a comparison between using jQuery and conventional javascript and here are my findings: 1

[jQuery] jQuery select all vs conventional javascript

2008-11-19 Thread JQueryProgrammer
Hi All, I have been using jQuery for quite some time now. For one of my projects, I needed to select all the options in the listbox which were 10,000+. I tried to do a comparison between using jQuery and conventional javascript and here are my findings: 1. With jQuery: Code:

[jQuery] Select all options on button click

2008-11-07 Thread JQueryProgrammer
Hi All, I am trying to write a JQuery function which would select all my options in the select control with the click of a button. I am able to do it with the following function: $(#btnAll).click(function() { $(#myselect *).attr(selected,selected); }); But the problem is my select list

[jQuery] Re: Select all options on button click

2008-11-07 Thread JQueryProgrammer
:28 pm, Liam Potter [EMAIL PROTECTED] wrote: why not have an all option in your select box and do the rest server side? JQueryProgrammer wrote: Hi All, I am trying to write a JQuery function which would select all my options in the select control with the click of a button. I am able to do

[jQuery] Simple Queires for Function calling

2008-09-26 Thread JQueryProgrammer
1. I have some simple queries with regards to function calling. In plain javascript if I want to call a javascript function from my HTMl tag i do it like: input type=text id=myid onclick=javascript:sayHello(this.id); value=World / Now my javascript function would be defined as function

[jQuery] contains() not working

2008-09-26 Thread JQueryProgrammer
I have an image tag as img id=myimg src=images/expand.jpg / I am trying as if($(#myimg).attr(src).contains(expand)) // do something else //do something else but it gives an error Object doesn't support this property of method. Please help.

[jQuery] Re: contains() not working

2008-09-26 Thread JQueryProgrammer
://docs.jquery.com/Selectors/attributeContains#attributevalue So in your example that would be if ( $(#myimg[src*='expand']).length )   // do something else   // do something else - Richard Richard D. Worthhttp://rdworth.org/ On Thu, Sep 25, 2008 at 11:21 PM, JQueryProgrammer [EMAIL PROTECTED

[jQuery] Re: Simple Queires for Function calling

2008-09-26 Thread JQueryProgrammer
. Worthhttp://rdworth.org/ On Thu, Sep 25, 2008 at 11:22 PM, JQueryProgrammer [EMAIL PROTECTED]wrote: 1. I have some simple queries with regards to function calling. In plain javascript if I want to call a javascript function from my HTMl tag i do it like: input type=text id=myid onclick

[jQuery] Problem with toggle

2007-12-24 Thread JQueryProgrammer
I am facing an issue with the toogle API. I have a tr with dynamic Id's as Id1, Id2 etc. Within that tr I have many td's in which one td has an image which needs to be toggled to plus image and minus image. That is when I click on the image, it should toggle between plus and minus images.

[jQuery] Reset values of Textboxes and Dropdowns

2007-12-21 Thread JQueryProgrammer
I have some textboxes and dropdowns on my page. now I already have a function which resets my fields. I can do it by $(#myFieldId)[0].value = ; OR $(#myFieldId)[0].selectedIndex = 0; Can I do it by some easy way..?

[jQuery] tr not applying CSS

2007-12-19 Thread JQueryProgrammer
I have a table that displays n rows based on the records from the database. For a particular row that gets displayed n times, I have assigned a name to the row. The row already has some CSS applied to it. But I want that whenever I take the mouse over the row, the new CC should get applied and