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.
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
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
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;,
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
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
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;
, 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
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,
/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
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.
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
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
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
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);
})
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
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',
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
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
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
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
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
$(input[name='myselect'] option:selected).val(); is not working. It
gives undefined. Can anyone please help.
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.
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
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
, 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
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
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
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
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.
: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
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
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,
.
-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
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:
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
: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
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
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.
://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
. 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
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.
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..?
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
45 matches
Mail list logo