[jQuery] not able to receive POST data in php file

2009-12-21 Thread Amit
i am using the following JQuery function to "successfully" POST data
to the user_submit.php file, its just that the php file is unable to
receive the data.

$(function() {
  $("#submit_js").click(function() {
$.post("user_submit.php", {
  comment: $("#comment").val()
});
  });
});

upon finishing the Firebug consoloe shows this:



Your vote was successfully registered!any text but this



i am pasting the user_submit.php here:




this is the HTML :

You are voting out . Care to explain why?
textarea




When I click on Submit, I can see in Firebug console that the data is
being POSTed. but i am not receiving that data in the php file. or
else i am not able to use it.

please help.




[jQuery] Re: (autocomplete) multiple inputbox using same autocomplete function

2009-10-01 Thread Amit

I know that we can use multiple selector in autocomplete function but
we can't access them in result function.



On Oct 2, 11:30 am, Amit  wrote:
> code at the bottom is working fine .. wherein data is coming from
> database via postcode.php in following format :
>
> 2221|BLAKEHURST|NSW
> 4401|ACKLAND|QLD
> 2221|BLAKEHURST|NSW
> 4401|ACKLAND|QLD
> 2221|BLAKEHURST|NSW
> 4401|ACKLAND|QLD
>
> Now issue is I have multiple postalcode, city and state input box in
> my code in same page like :
>
> 
> 
> 
>
> 
> 
> 
>
> 
> 
> 
>
> How should I go in this case ??
>
> I just don't want to repeat the javascript code for them. Is there any
> way I can pass variable seelctors and can get back result in same
> way ?
>
> -
>
>                      "http://www.w3.org/TR/html4/loose.dtd";>
> 
> 
>   http://code.jquery.com/jquery-latest.js"</a>;>
>   http://dev.jquery.com/view/trunk/
> plugins/autocomplete/demo/main.css" type="text/css" />
>   http://dev.jquery.com/view/trunk/
> plugins/autocomplete/jquery.autocomplete.css" type="text/css" />
>   http://dev.jquery.com/view/trunk/</a>
> plugins/autocomplete/lib/jquery.bgiframe.min.js">
>   http://dev.jquery.com/view/trunk/</a>
> plugins/autocomplete/lib/jquery.dimensions.js">
>   </
> script>
>   <script>
>
>   $(document).ready(function(){
>
> $("#postalcode").autocomplete("inc/postcode.php", {
>                 width: 260,
>                 selectFirst: false,
>                 formatItem: function(data, i, n, value) {
>                 return data[0] + "," + data[1] + "," + data[2];
>                 }
>         });
>
> $("#postalcode").result(function(event, data, formatted) {
>                 if (data)
>                         {
>                         $("input#postalcode").val(data[0]);
>                         $("input#city").val(data[1]);
>                         $("input#state").val(data[2]);
>                         }
>
>         });
>
>   });
>   
>
> 
> 
> 
> 
> 
>
> 
> 


[jQuery] (autocomplete) multiple inputbox using same autocomplete function

2009-10-01 Thread Amit

code at the bottom is working fine .. wherein data is coming from
database via postcode.php in following format :

2221|BLAKEHURST|NSW
4401|ACKLAND|QLD
2221|BLAKEHURST|NSW
4401|ACKLAND|QLD
2221|BLAKEHURST|NSW
4401|ACKLAND|QLD

Now issue is I have multiple postalcode, city and state input box in
my code in same page like :















How should I go in this case ??

I just don't want to repeat the javascript code for them. Is there any
way I can pass variable seelctors and can get back result in same
way ?

-

http://www.w3.org/TR/html4/loose.dtd";>


  http://code.jquery.com/jquery-latest.js";>
  http://dev.jquery.com/view/trunk/
plugins/autocomplete/demo/main.css" type="text/css" />
  http://dev.jquery.com/view/trunk/
plugins/autocomplete/jquery.autocomplete.css" type="text/css" />
  http://dev.jquery.com/view/trunk/
plugins/autocomplete/lib/jquery.bgiframe.min.js">
  http://dev.jquery.com/view/trunk/
plugins/autocomplete/lib/jquery.dimensions.js">
  
  


  $(document).ready(function(){




$("#postalcode").autocomplete("inc/postcode.php", {
width: 260,
selectFirst: false,
formatItem: function(data, i, n, value) {
return data[0] + "," + data[1] + "," + data[2];
}
});


$("#postalcode").result(function(event, data, formatted) {
if (data)
{
$("input#postalcode").val(data[0]);
$("input#city").val(data[1]);
$("input#state").val(data[2]);
}

});





  });
  











[jQuery] JQuery lightbox plugin through we can show flash in overlay..

2009-08-09 Thread Amit





Hi 

Is there any jQuery light box plugin by which I can make my flash look
in the overlay window. 

I had searched for one  named fancyZOOM .js  but don't know why it is not working
for multiple flash in a single page. 

any body having any idea pls reply ..  I am struck here.

thanks 














Regards, 
Amit Kr. Sharma

 






[jQuery] Re: DISABLE BUTTON AFTER 1 CLICK ->JQUERY: NOT WORKING WITH IE8

2009-07-07 Thread Amit Rampurkar
Hello Cesar,

The code didn't work with IE 7 too. Well, for the double submit, even I
don't know exactly. It was a part of a code I got from somewhere.
However as of now, I have modified the code so that it hides the submit
button and gives a loading.gif image file. This works with IE too.
Finally a working version for IE :)

Thanks a lot for your help though and hoping to get help the next time I
step back in here with any queries.


Regards,
~Amit

On Tue, Jul 7, 2009 at 9:38 AM, Cesar Sanz wrote:

>
> Sorry for my suggestion, I misread your point, thought you were not able to
> disable your button.
>
> You say it works in FF, Have your tried this same code in IE 7.0 ? Does it
> works?
>
> I can see in your code that you bind a submit event to the #node-form
> twice,
> why is that?
>
> $(document).ready(function() {
>$('#node-form').submit(function (e)
> {   // <*** HERE
> var settings = Drupal.settings.block_submit;
>if (settings.block_submit_method == 'disable') {
>$('input[type=submit]', $(this)).attr('disabled',
> 'true').each(function (i) {
> });
>$(this).submit(function (e)
> {  // <*** HERE
>   return false;
>});
>}
>return true;
>   });
>  });
>
> - Original Message -
> From: "Amit" 
> To: "jQuery (English)" 
> Sent: Monday, July 06, 2009 1:37 PM
> Subject: [jQuery] Re: DISABLE BUTTON AFTER 1 CLICK ->JQUERY: NOT WORKING
> WITH IE8
>
>
>
> Hi Cesar,
>
> Thanks for your reply. But that isn't working. It still gives me the
> same result. The form does not post. It is just that the button gets
> disabled after click.
> Wonder why it works properly in Firefox and Chrome but not in IE.. :(
> Please help.
>
>
> ~Amit
>
> On Jul 6, 2:14 pm, "Cesar Sanz"  wrote:
> > try
> >
> > .attr('disabled', 'disabled') instead of .attr('disabled', 'true')
> >
> > - Original Message -
> > From: "Amit" 
> > To: "jQuery (English)" 
> > Sent: Monday, July 06, 2009 10:50 AM
> > Subject: [jQuery] DISABLE BUTTON AFTER 1 CLICK ->JQUERY: NOT WORKING WITH
> >
> > IE8
> >
> > > Hello there,
> >
> > > I am using Drupal forms with Jquery. I used the following code to
> > > disable a button after it is clicked to prevent double updates.
> >
> > > $(document).ready(function() {
> > > $('#node-form').submit(function (e) {
> > > var settings = Drupal.settings.block_submit;
> > > if (settings.block_submit_method == 'disable') {
> > > $('input[type=submit]', $(this)).attr('disabled', 'true').each
> > > (function (i) {
> > > });
> > > $(this).submit(function (e) {
> > > return false;
> > > });
> > > }
> > > return true;
> > > });
> > > });
> >
> > > Form ID should be specific to: "node-form".
> >
> > > This structure works fine with Firefox and Chrome but does not work
> > > with IE8 / 7 (compatibility mode).
> > > When I click the submit button for the form in IE, it disables the
> > > button but the form never submits. (it behaves like an AJAX button
> > > where it gets disabled without the submit action ever happening)
> >
> > > How do I solve this? Please help me out of this...
> >
> > > Thanks,
> > > ~Amit
> >
> >
>
>
> >
>


[jQuery] Re: DISABLE BUTTON AFTER 1 CLICK ->JQUERY: NOT WORKING WITH IE8

2009-07-06 Thread Amit Rampurkar
Here is the code from the view source window in IE for the submit button if
this can help:

Now uploading
...(This
may take a minute)



Thanks,
~Amit



On Mon, Jul 6, 2009 at 2:37 PM, Amit  wrote:

>
> Hi Cesar,
>
> Thanks for your reply. But that isn't working. It still gives me the
> same result. The form does not post. It is just that the button gets
> disabled after click.
> Wonder why it works properly in Firefox and Chrome but not in IE.. :(
> Please help.
>
>
> ~Amit
>
> On Jul 6, 2:14 pm, "Cesar Sanz"  wrote:
> > try
> >
> > .attr('disabled', 'disabled') instead of .attr('disabled', 'true')
> >
> > - Original Message -
> > From: "Amit" 
> > To: "jQuery (English)" 
> > Sent: Monday, July 06, 2009 10:50 AM
> > Subject: [jQuery] DISABLE BUTTON AFTER 1 CLICK ->JQUERY: NOT WORKING WITH
> >
> > IE8
> >
> > > Hello there,
> >
> > > I am using Drupal forms with Jquery. I used the following code to
> > > disable a button after it is clicked to prevent double updates.
> >
> > > $(document).ready(function() {
> > > $('#node-form').submit(function (e) {
> > > var settings = Drupal.settings.block_submit;
> > > if (settings.block_submit_method == 'disable') {
> > > $('input[type=submit]', $(this)).attr('disabled', 'true').each
> > > (function (i) {
> > > });
> > > $(this).submit(function (e) {
> > > return false;
> > > });
> > > }
> > > return true;
> > > });
> > > });
> >
> > > Form ID should be specific to: "node-form".
> >
> > > This structure works fine with Firefox and Chrome but does not work
> > > with IE8 / 7 (compatibility mode).
> > > When I click the submit button for the form in IE, it disables the
> > > button but the form never submits. (it behaves like an AJAX button
> > > where it gets disabled without the submit action ever happening)
> >
> > > How do I solve this? Please help me out of this...
> >
> > > Thanks,
> > > ~Amit
> >
> >
> >
>


[jQuery] Re: DISABLE BUTTON AFTER 1 CLICK ->JQUERY: NOT WORKING WITH IE8

2009-07-06 Thread Amit

Hi Cesar,

Thanks for your reply. But that isn't working. It still gives me the
same result. The form does not post. It is just that the button gets
disabled after click.
Wonder why it works properly in Firefox and Chrome but not in IE.. :(
Please help.


~Amit

On Jul 6, 2:14 pm, "Cesar Sanz"  wrote:
> try
>
> .attr('disabled', 'disabled') instead of .attr('disabled', 'true')
>
> - Original Message -
> From: "Amit" 
> To: "jQuery (English)" 
> Sent: Monday, July 06, 2009 10:50 AM
> Subject: [jQuery] DISABLE BUTTON AFTER 1 CLICK ->JQUERY: NOT WORKING WITH
>
> IE8
>
> > Hello there,
>
> > I am using Drupal forms with Jquery. I used the following code to
> > disable a button after it is clicked to prevent double updates.
>
> > $(document).ready(function() {
> > $('#node-form').submit(function (e) {
> > var settings = Drupal.settings.block_submit;
> > if (settings.block_submit_method == 'disable') {
> > $('input[type=submit]', $(this)).attr('disabled', 'true').each
> > (function (i) {
> > });
> > $(this).submit(function (e) {
> > return false;
> > });
> > }
> > return true;
> > });
> > });
>
> > Form ID should be specific to: "node-form".
>
> > This structure works fine with Firefox and Chrome but does not work
> > with IE8 / 7 (compatibility mode).
> > When I click the submit button for the form in IE, it disables the
> > button but the form never submits. (it behaves like an AJAX button
> > where it gets disabled without the submit action ever happening)
>
> > How do I solve this? Please help me out of this...
>
> > Thanks,
> > ~Amit
>
>


[jQuery] DISABLE BUTTON AFTER 1 CLICK ->JQUERY: NOT WORKING WITH IE8

2009-07-06 Thread Amit

Hello there,

I am using Drupal forms with Jquery. I used the following code to
disable a button after it is clicked to prevent double updates.

$(document).ready(function() {
$('#node-form').submit(function (e) {
var settings = Drupal.settings.block_submit;
if (settings.block_submit_method == 'disable') {
$('input[type=submit]', $(this)).attr('disabled', 'true').each
(function (i) {
});
$(this).submit(function (e) {
return false;
});
}
return true;
});
});


Form ID should be specific to: "node-form".

This structure works fine with Firefox and Chrome but does not work
with IE8 / 7 (compatibility mode).
When I click the submit button for the form in IE, it disables the
button but the form never submits. (it behaves like an AJAX button
where it gets disabled without the submit action ever happening)

How do I solve this? Please help me out of this...


Thanks,
~Amit


[jQuery] Unique url and browser back button in an ajaxified page.

2009-07-02 Thread Amit





Hi, 

Does jQuery provides any feature  or  plugin to handle unique url and 
browser back button in an ajaxified page.

thanks in advance.

-- 












Regards, 
Amit Kr. Sharma








[jQuery] jQuery get JSON error "data.channel is undefined"

2009-06-20 Thread Amit







Error: data.channel is undefined
Source File: http://203.129.220.178/gri-valudeal/new.html
Line: 131

 line :131 bcontains the function :    getJSON


Any one having any idea why this error is coming.


-- 












Regards, 
Amit Kr. Sharma
Mobile:  09780141161
Profile:
  http://www.linkedin.com/in/amit2sharma
Email id:
 amit.mca...@gmail.com
 






[jQuery] Re: using find method on a documentFragment attached node

2009-06-12 Thread amit

Thanks for the reply. I had given this a try but sadly it doesn't work
as expected. I did some research on documentFragments and found
following on http://ejohn.org/blog/dom-documentfragments/#comment-319149
(need to click "Show Comments" to reach this place) -

"# Obvious, but sometimes overlooked: the fragment is self contained.
This means, the fragment doesn't have access to objects outside of it
(i.e. part of the main document). Thus, even if you have CSS classes
(class attribute) set in an element, it is not possible to query based
on properties set and/or modified by that CSS class. Basically the
classes set in the class attribute, if defined outside the fragment,
become just simple labels."

so this means searching elements inside the fragment is not supported.

Is there any work around available for this?

Thanks,
amit

On Jun 12, 5:36 am, Charlie  wrote:
> var d=$('div.pointer').length;
> alert(d);
> amit wrote:Hi, I am writing an application that converts an ajax xml response 
> into html using client side xslt transformation. The transformation is 
> achieved using following snippet, which works fine - transform:function(xml){ 
> if (window.XSLTProcessor){ var xsltProcessor = new XSLTProcessor(); 
> xsltProcessor.importStylesheet(Xmer.xsldoc); var outputXHTML = 
> xsltProcessor.transformToFragment(Xmer.makeXml (xml), document); 
> document.getElementById('tree').appendChild(outputXHTML.cloneNode (true)); } 
> else if(window.ActiveXObject){ //Internet Explorer var d=Xmer.makeXml(xml); 
> var outputXHTML = (d).transformNode(Xmer.xsldoc); 
> document.getElementById('tree').innerHTML=outputXHTML; } } But problem is 
> encountered in FF when i try to process the inserted tags using jquery's find 
> method. I am trying to fetch all the divs with a specific class name that 
> were inserted by the above code using following - var 
> d=$document.find('div.pointer'); alert (d.length); but the above alert always 
> returns "0" length. The same code works fine in IE. I am using jquery 1.3.2. 
> I apologize if something along these lines has been discussed earlier and 
> would appreciate if someone guides me in this. Thanks, amit


[jQuery] using find method on a documentFragment attached node

2009-06-11 Thread amit

Hi,

I am writing an application that converts an ajax xml response into
html using client side xslt transformation. The transformation is
achieved using following snippet, which works fine -

transform:function(xml){
if (window.XSLTProcessor){
var xsltProcessor = new XSLTProcessor();
xsltProcessor.importStylesheet(Xmer.xsldoc);
var outputXHTML = 
xsltProcessor.transformToFragment(Xmer.makeXml
(xml), document);

document.getElementById('tree').appendChild(outputXHTML.cloneNode
(true));
}
else if(window.ActiveXObject){  //Internet Explorer
var d=Xmer.makeXml(xml);
var outputXHTML = (d).transformNode(Xmer.xsldoc);
document.getElementById('tree').innerHTML=outputXHTML;
}
}


But problem is encountered in FF when i try to process the inserted
tags using jquery's find method. I am trying to fetch all the divs
with a specific class name that were inserted by the above code using
following -
var d=$document.find('div.pointer');
   alert (d.length);

but the above alert always returns "0" length.  The same code works
fine in IE. I am using jquery 1.3.2.

I apologize if something along these lines has been discussed earlier
and would appreciate if someone guides me in this.

Thanks,
amit



[jQuery] IFrame caching in Firefox

2009-06-05 Thread Amit Saurav

Hello,

I am using a jQuery script to insert iframe in the document after the
page load completes as follows:

jQuery(window).load(function() {
var container = jQuery(‘#container_id”);
jQuery(‘’).prependTo(container);
});

Apparently there is a problem (or probably a speed-up trick) with
Firefox where it tries to cache any iframe content so that next time
when you come back to the page (using forward or back button), it
fetches the content of the iframe from its cache rather than making a
new request. This is a problem to my usecase as the number of request
received by the server is of high importance.

Hence to get around this caching issue I have a small piece of
cache-busting code just after prependTo() call above, which forces a
reload of the iframe is as follows:

if ((navigator.userAgent.indexOf("Firefox") > -1) &&
(navigator.userAgent.indexOf("Windows") > -1)) {
var i = document.getElementById("my_iframe");
if (i) {
i.src="www.some-url.com";
}
}

I read somewhere that when we add iframes to the DOM dynamically, it
actually takes some amount of time before which it can be queried
using the standard DOM manipulation function. So, I am suspecting that
for most of the time my cache-busting code above does not do anything,
but it’s hard to spot the error as it could be happening only 1 in 10
times or less.

My question is, would using jQuery’s selector to get the iframe node
for cache-busting help me get around this iframe-ready-to-query delay?
I just want to ensure that my cache-busting code runs every time its
meant to run.

I appreciate any help.

Thanks,


[jQuery] Using jQuery to insert IFrame dynamically after page loads.

2009-06-05 Thread Amit Saurav

Hello,

I have a use case in which I need to insert an IFrame as a child to an
existing DIV just after the page load completes. That is, the request
to fetch content for this Iframe should go to the server "after" all
the media in the page has loaded, basically after the page "load"
event and not the document ready event.

My document structure is as follows:




  






 Some Text 




The structure of the document is such that both the header (the first
DIV child above) and the footer (the last P child above) may or may
not be present in the final document sent by the server. Thus i wrote
a jQuery script as follows:

jQuery(window).load(function() {
var divContainer = jQuery('#container_div');
<#if header_present??>

jQuery('#container_div').children('div:first').after('${iframeContent}');
<#else>
jQuery('${iframeContent}').prependTo(divContainer);

});

The decision of whether the header or footer is present is done using
Freemarker that is aside from the topic of this discussion. Basically,
i see if the header is present then add the iframe after the header
div and if not, just add it as the first child. Here ${iframeContent}
is a variable that stores the iframe tag as a text like:

$iframeContent = 'http://www.myserver.com";>';

My script runs fine but just that it fails sometimes (10 in a 100)
because of reasons I am finding out here. I wanted your opinion on the
following:

1. Using jQuery(window).load: Is it a good way to capture onload event
of the page? Or do we have a robust way to capture page loads?
2. Is the sandwiching logic of the iframe the correct way to do it or
could it fail in any scenario?


I appreciate any help in this issue.

Thanks!


[jQuery] HELP jQuery and Ajax form submission !!!!!!!!!!!!!!!! help ! help !! help !!!! help !! help !! help !!

2009-06-03 Thread Amit





Hi Group , 

I had a problem using jQuery and cakephp, I am submitting a form
through the jquery, on the click of an image.


All validation is checked , data string is formed, success function
works but the url is not hitted , dont know why.


Here is the _javascript_  code, 


<br>
<br>
function CheckEmail(email)<br>
{<br>
    var filter =
/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i<br>
    if(!filter.test(email)){<br>
        return false;<br>
    }<br>
    return true;<br>
}<br>
<br>
$(document).ready(function() {<br>
    $('#submitdiv').click(function(){    <br>
        <br>
    var iAppName = document.getElementById('iAppName').value;<br>
    var iName = document.getElementById('iName').value;<br>
    var iEmail = document.getElementById('iEmail').value;<br>
    var iSubmit = document.getElementById('iSubmit').value;<br>
    var iComment = document.getElementById('iComment').value;<br>
    var _str = '';<br>
    <br>
    if(iAppName == '' || iAppName == 'Application Name'){<br>
        _str += 'Please enter application name.'+"\n";<br>
    }<br>
    if(iName == '' || iName == 'Name'){<br>
        _str += 'Please enter your name.'+"\n";<br>
    }<br>
    if(!CheckEmail(iEmail)){<br>
        _str += 'Please enter valid email address.'+"\n";<br>
    }<br>
    if(iSubmit == '' || iSubmit == 'Subject'){<br>
        _str += 'Please enter subject.'+"\n";<br>
    }<br>
    if(iComment == '' || iComment == 'Comments'){<br>
        _str += 'Please enter your comments.';<br>
    }<br>
    if(_str.length > 0){<br>
        alert(_str);<br>
        return false;<br>
    }<br>
        var dataString = 'appname='+ iAppName + '&name='+ iName +
'&subject='+ iSubmit + '&email=' + iEmail + '&comment=' +
iComment;<br>
        <br>
        $.ajax({<br>
            type: 'POST',<br>
            url: '/appstore/feature_myapp',   <font color="#009900">//appstore
controller and feature_myapp function </font><br>
            data: dataString,<br>
            success: function() {<br>
                $('#feuappsdiv').append("<div
id='message'></div>");<br>
                $('#message').html("<h6 style='padding:5px 0 0
20px;color:red;'>Request Submitted!</h6>")<br>
                .fadeOut(5000, function() {<br>
                });<br>
            }<br>
            });<br>
             $('#message').remove();<br>
        <br>
        });<br>
    });<br>


Html Code is ::


        
          
        
        
        
        Comments

        
            "_javascript_:document.getElementById('content_feature_app').style.display='none';"
src="" name="submit" title="submit" alt="Close"
/>
            
        
    
            

Any knid of help is appreciated.

thanks 
-- 












Regards, 
Amit Kr. Sharma
Profile:
  http://www.linkedin.com/in/amit2sharma
Email id:
 amit.mca...@gmail.com
 






[jQuery] Select box// onchange in niceform doesn't work !!

2009-05-26 Thread Amit





Hi Guys , 

I am using the niceforms.js to change the look of the fields. 
but came to know that the onchange event for select boxes in such a
form doesn't work, as the niceforms.js replaces the select box with divs


Any one have any solution, how to implement the onchange event in such
a situation, or any work around.

Any kind of help is appreciable , 

thanks

-- 












Regards, 
Amit Kr. Sharma
Profile:
  http://www.linkedin.com/in/amit2sharma


 






[jQuery] [Form submittion not working]>>any error in the code..... please check

2009-05-02 Thread Amit





$(document).ready(
        funtion(){
        return false;
            $("#send").click(
                function(){
                    $.post("lib/ajax/requests.php",
                                { 
                                    action: "postrecommendmypros", 
                                    projectname: {ALL_SEARCH_TXT}, 
                                    firstname: {CLIENT_FIRSTNAME}, 
                                    lastname: {CLIENT_LASTNAME}, 
                                    id: {CLIENT_LASTNAME}, 
                                    project_id: {ALL_REQUEST_PID},
                                    url:{ALL_MY_REQUESTS_REDIRECT},
                                    id: {EMAIL_UID}
                                }, 
                                function(data){
                                   
window.location={ALL_MY_REQUESTS_REDIRECT};
                                }
                        );                    
                    return false;
                }
                showNotice('Response posted!','Project '+ projectname);
            );
        }
    );    
-- 












Regards, 
Amit Kr. Sharma
Mobile:  09780141161
Profile:
  http://www.linkedin.com/in/amit2sharma
Email id:
 amit.mca...@gmail.com
 






[jQuery] How to adjust the position of the of the error message in jQuery

2009-04-17 Thread Amit





Hi 
 
is there any way  by which we can adjust the position of the of the
error message  in jQuery... 

i.e, not after the input box , some container that I specify (through
id). 

Thanks 
Amit Shrama   



 






[jQuery] IE freez when I open a page with tabs.

2009-03-31 Thread amit

Hi All,
I am having a problem recently.
I am using jQuery-1.3.2.min and my page freeze. It force me to kill
the IE from task manager.
But strange thing is, it was working fine earlier, all of sudden I
don't know why its creating problems.
My content page is huge and I thought may be its lot of data but  it
worked before.
Anyone know why its freezing or how can I debug to find out who is
responsible for this.
It works fine in FF.

Regards,
Amit


[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-27 Thread Amit Shah

thanks mkmanning,
but i do not using jquery now, i using prototype now.
anyway i have moved the script to main page. will try another time.

On Mar 27, 1:42 am, mkmanning  wrote:
> Did you try my suggestion?
> --
> Put this div in your main page:
> 
> --
> Put this script in your main page (essentially what you have already,
> fix the url for your server):
> $(document).ready(function(){
>          $.ajax({
>                          type:"GET",
>                          url:"/testajax.html",
>                          dataType: "html",
>                          success:
>                                          function(data, status)
>                                          {
>                                                           
> $('#test').html(data);
>                                          }
>                         });
>
> });
>
> --
> Put this in your ajax response (call it testajax.html or whatever
> you're calling):
> 
> function sometesting(){
>         alert('this works');}
>
> //attach event with jQuery, even though there's no 'jQuery'
> //on this page (it will inherit from the page it's injected in)
> $('#tdtest').mouseover(sometesting);
> 
>
> 
>         
>                 Inline (bad practice) 
> works td>
>                 Attached with jQuery (good practice) 
> works tr>
>         
> 
> --
>
> So there's a function in the response ajax called sometesting(). It's
> called in two ways:
> by an inline mouseover, and by a jQuery selector (take your pick)--
> both methods are on the ajax page.
>
> No higher power need be invoked.
>
> On Mar 26, 12:53 pm, Amit Shah  wrote:
>
> > oh god.
>
> > i got a function sometesting() in the ajax response text ok? not in
> > calling main page. it's in response html data from ajax.
> > in response there is a table. in table there is a td and on td
> > mouseover event i call that function to highlight some fields.
>
> > now the function cam from response text. ok? read properly, the
> > response text is cam in main page div tag now.
> > if i call the function from main page anywhere it works.
> > but the actual even that is on mouse over of that td in response text
> > it don't works. it says not define.
>
> > now ?
>
> > On Mar 27, 12:10 am, James  wrote:
>
> > > What do you mean? Could you provide an example of the content of your
> > > response and what you want to do with it?
>
> > > You cannot call a function from inside the response html data before
> > > it reaches the browser. It has to reach the browser first because the
> > > browser does the Javascript work. If you want to do it before then,
> > > you'd have to do it server-side before sending the response.
>
> > > On Mar 26, 2:14 am, Amit Shah  wrote:
>
> > > > you didn't get it.
> > > > i mean the function written in response text. which has be evaluated.
> > > > can be called only from the main script. not from inside the responsed
> > > > html data.
>
> > > > On Mar 24, 8:07 pm, mkmanning  wrote:
>
> > > > > If you're going to use jQuery, you have to be careful about writing
> > > > > code that then doesn't use jQuery. In this case, you're ajax call
> > > > > would have worked fine, if you had stuck with injecting the response
> > > > > into the DOM with jQuery, as it automatically evals scripts in a
> > > > > response with dataType of 'html'.
>
> > > > > Change:
> > > > > contentDiv.innerHTML = data
>
> > > > > to (with the appropriate selector for your div):
> > > > >  $('div').html(data);
>
> > > > > On Mar 24, 3:44 am, Amit Shah  wrote:
>
> > > > > > it's not working.
>
> > > > > > well eval(responseText); don't works.
>
> > > > > > cells = divResult.getElementsByTagName("script");
> > > > > >                         alert(cells.length);
> > > > > >                         for (var i = 0; i < cells.length; i++)
> > > > > >                         {
> > > > > >                

[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-26 Thread Amit Shah

oh god.

i got a function sometesting() in the ajax response text ok? not in
calling main page. it's in response html data from ajax.
in response there is a table. in table there is a td and on td
mouseover event i call that function to highlight some fields.

now the function cam from response text. ok? read properly, the
response text is cam in main page div tag now.
if i call the function from main page anywhere it works.
but the actual even that is on mouse over of that td in response text
it don't works. it says not define.

now ?

On Mar 27, 12:10 am, James  wrote:
> What do you mean? Could you provide an example of the content of your
> response and what you want to do with it?
>
> You cannot call a function from inside the response html data before
> it reaches the browser. It has to reach the browser first because the
> browser does the Javascript work. If you want to do it before then,
> you'd have to do it server-side before sending the response.
>
> On Mar 26, 2:14 am, Amit Shah  wrote:
>
>
>
> > you didn't get it.
> > i mean the function written in response text. which has be evaluated.
> > can be called only from the main script. not from inside the responsed
> > html data.
>
> > On Mar 24, 8:07 pm, mkmanning  wrote:
>
> > > If you're going to use jQuery, you have to be careful about writing
> > > code that then doesn't use jQuery. In this case, you're ajax call
> > > would have worked fine, if you had stuck with injecting the response
> > > into the DOM with jQuery, as it automatically evals scripts in a
> > > response with dataType of 'html'.
>
> > > Change:
> > > contentDiv.innerHTML = data
>
> > > to (with the appropriate selector for your div):
> > >  $('div').html(data);
>
> > > On Mar 24, 3:44 am, Amit Shah  wrote:
>
> > > > it's not working.
>
> > > > well eval(responseText); don't works.
>
> > > > cells = divResult.getElementsByTagName("script");
> > > >                         alert(cells.length);
> > > >                         for (var i = 0; i < cells.length; i++)
> > > >                         {
> > > >                                 alert(cells[i].innerHTML);
> > > >                             eval(cells[i].innerHTML);
> > > >                     }
> > > >                     sometesting(5);
>
> > > > is working.
> > > > but when the function sometesting() being called somewhere from
> > > > ajaxresponse text, browser gives error. both ie and firefox.
>
> > > > On Mar 15, 7:47 am, NightWatchman  wrote:
>
> > > > > To execute javascript code returned by the server you need to use the
> > > > > javascript eval function on the string of script returned from the
> > > > > server. As far as I know changing the content of a div to a javascript
> > > > > block won't cause that javascript code to execute.
>
> > > > > I think you need to change:
>
> > > > > contentDiv.innerHTML = data;
>
> > > > > to
>
> > > > > eval(data);
>
> > > > > On Mar 14, 3:12 pm, Foreigner  wrote:
>
> > > > > > Hi,
> > > > > > I'm trying to use jQuery to get some HTML with Javascript using 
> > > > > > AJAX.
> > > > > > My response gets inserted into the contentDiv element but my
> > > > > > javascript inside the response doesn't get executed as the
> > > > > > documentation says (http://docs.jquery.com/
> > > > > > Specifying_the_Data_Type_for_AJAX_Requests).
>
> > > > > > Here goes my function with AJAX call:
>
> > > > > > function loadHtml(obj)
> > > > > > {
> > > > > >         if(obj.className == "menuItem")
> > > > > >         {
> > > > > >                 $.ajax({
> > > > > >                                  type:"GET",
> > > > > >                                  url:"content/" + obj.id + ".html",
> > > > > >                                  dataType: "html",
> > > > > >                                  success:
> > > > > >                                          function(data, status)
> > > > > >                                          {
> > > > > >                                                   
> > > > > > contentDiv.innerHTML = data;
> > > > > >                                          }
> > > > > >                                 });
> > > > > >         }
>
> > > > > > }
>
> > > > > > My response looks like:
>
> > > > > > Some heading
> > > > > > 
>
> > > > > > //Some javascript code
>
> > > > > > - Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-26 Thread Amit Shah

you didn't get it.
i mean the function written in response text. which has be evaluated.
can be called only from the main script. not from inside the responsed
html data.


On Mar 24, 8:07 pm, mkmanning  wrote:
> If you're going to use jQuery, you have to be careful about writing
> code that then doesn't use jQuery. In this case, you're ajax call
> would have worked fine, if you had stuck with injecting the response
> into the DOM with jQuery, as it automatically evals scripts in a
> response with dataType of 'html'.
>
> Change:
> contentDiv.innerHTML = data
>
> to (with the appropriate selector for your div):
>  $('div').html(data);
>
> On Mar 24, 3:44 am, Amit Shah  wrote:
>
> > it's not working.
>
> > well eval(responseText); don't works.
>
> > cells = divResult.getElementsByTagName("script");
> >                         alert(cells.length);
> >                         for (var i = 0; i < cells.length; i++)
> >                         {
> >                                 alert(cells[i].innerHTML);
> >                             eval(cells[i].innerHTML);
> >                     }
> >                     sometesting(5);
>
> > is working.
> > but when the function sometesting() being called somewhere from
> > ajaxresponse text, browser gives error. both ie and firefox.
>
> > On Mar 15, 7:47 am, NightWatchman  wrote:
>
> > > To execute javascript code returned by the server you need to use the
> > > javascript eval function on the string of script returned from the
> > > server. As far as I know changing the content of a div to a javascript
> > > block won't cause that javascript code to execute.
>
> > > I think you need to change:
>
> > > contentDiv.innerHTML = data;
>
> > > to
>
> > > eval(data);
>
> > > On Mar 14, 3:12 pm, Foreigner  wrote:
>
> > > > Hi,
> > > > I'm trying to use jQuery to get some HTML with Javascript using AJAX.
> > > > My response gets inserted into the contentDiv element but my
> > > > javascript inside the response doesn't get executed as the
> > > > documentation says (http://docs.jquery.com/
> > > > Specifying_the_Data_Type_for_AJAX_Requests).
>
> > > > Here goes my function with AJAX call:
>
> > > > function loadHtml(obj)
> > > > {
> > > >         if(obj.className == "menuItem")
> > > >         {
> > > >                 $.ajax({
> > > >                                  type:"GET",
> > > >                                  url:"content/" + obj.id + ".html",
> > > >                                  dataType: "html",
> > > >                                  success:
> > > >                                          function(data, status)
> > > >                                          {
> > > >                                                   contentDiv.innerHTML 
> > > > = data;
> > > >                                          }
> > > >                                 });
> > > >         }
>
> > > > }
>
> > > > My response looks like:
>
> > > > Some heading
> > > > 
>
> > > > //Some javascript code
>
> > > > 


[jQuery] Re: Executing javascript that comes inside an AJAX response

2009-03-24 Thread Amit Shah

it's not working.

well eval(responseText); don't works.

cells = divResult.getElementsByTagName("script");
alert(cells.length);
for (var i = 0; i < cells.length; i++)
{
alert(cells[i].innerHTML);
eval(cells[i].innerHTML);
}
sometesting(5);


is working.
but when the function sometesting() being called somewhere from
ajaxresponse text, browser gives error. both ie and firefox.

On Mar 15, 7:47 am, NightWatchman  wrote:
> To execute javascript code returned by the server you need to use the
> javascript eval function on the string of script returned from the
> server. As far as I know changing the content of a div to a javascript
> block won't cause that javascript code to execute.
>
> I think you need to change:
>
> contentDiv.innerHTML = data;
>
> to
>
> eval(data);
>
> On Mar 14, 3:12 pm, Foreigner  wrote:
>
> > Hi,
> > I'm trying to use jQuery to get some HTML with Javascript using AJAX.
> > My response gets inserted into the contentDiv element but my
> > javascript inside the response doesn't get executed as the
> > documentation says (http://docs.jquery.com/
> > Specifying_the_Data_Type_for_AJAX_Requests).
>
> > Here goes my function with AJAX call:
>
> > function loadHtml(obj)
> > {
> >         if(obj.className == "menuItem")
> >         {
> >                 $.ajax({
> >                                  type:"GET",
> >                                  url:"content/" + obj.id + ".html",
> >                                  dataType: "html",
> >                                  success:
> >                                          function(data, status)
> >                                          {
> >                                                   contentDiv.innerHTML = 
> > data;
> >                                          }
> >                                 });
> >         }
>
> > }
>
> > My response looks like:
>
> > Some heading
> > 
>
> > //Some javascript code
>
> > 


[jQuery] Question Regarding Superfish

2009-01-21 Thread Amit Shah

Hi,

I am trying to use Superfish Jquery menu in IE6.

It all works fine except that the menu which have sub menus displays 2
arrows next to the text.

I am using the following code:

// initialise Superfish


$(document).ready(function(){
$("ul.sf-menu").superfish();
});



Can someone help me out?

Thanks in advance.

Kind Regards,

Amit Shah


[jQuery] issue regarding superfish horizontal menu

2008-12-23 Thread Amit Negi

Hai Joel

Please let us know one thing is that menu (ul item) are appearing
smooth on internet exploer 7. But problem is that the (li item) is not
showing smooth on internet explorer 7. li item edges is too sharp than
Ul item.

Please let us know how can i do it smooth.

Thanks


Best Regards
Amit Negi


[jQuery] using my{} instead of ${}.

2008-11-06 Thread Amit Sharma
Hi

Can I use any other character in my jquery functions.  Thats may be using
my{} instead of ${}.

Thanks
Amit Sharma


[jQuery] Problems with Firefox and JCarousel

2008-11-04 Thread Amit

forgot to mention that it's Jcarousel i'm about.


[jQuery] Problems with Firefox

2008-11-03 Thread Amit

hi all,
installed the plugin and it works great of Safari but i seem to have
problems in firefox, it looks like it doesn't initialize the plugin..
u can see sample here http://new.yalla-ya.com/melinda-nicci/ .
i also dont get any errors at all in the console, don't see how it is
related but it's built on wordpress.
i also tried adding the ($.browser.safari || $.browser.mozilla) hack
from one the other posts but nothing..
i also tried removing completely the other jquery scripts i have there
and nothing helps.
thanks for any help and for the precious time!
Amit


[jQuery] Table Manipulation Help!

2008-06-13 Thread Amit

Hello all. I'm new to jQuery and Javascript. I've been trying to solve
a problem since last 2 days.. :(
Here is my HTML:


  
1
2
3
  
  
4
5
6
  


In this table you can see that 2nd column has links. Now what I want
to do is copy the respective links to 1st column. So, it should look
like:


  
1
2
3
  
  
4
5
6
  


I've taken 2 rows, but I want the code to be row number independent.


[jQuery] Table Manipulation Help!

2008-06-13 Thread Amit

Hello all. I'm new to jQuery and Javascript. I've been trying to solve
a problem since last 2 days.. :(
Here is my HTML:


  
1
2
3
  
  
4
5
6
  


In this table you can see that 2nd column has links. Now what I want
to do is copy the respective links to 1st column. So, it should look
like:


  
1
2
3
  
  
4
5
6
  


I've taken 2 rows, but I want the code to be row number independent.


[jQuery] getting value out of datepicker

2008-04-24 Thread Amit Uchat
Hi,

I want to display some default date in a TextBox element.


I have bind datepicker to "startDate" with some default date On document
ready function.
jQuery('#startDate').datepicker({defaultDate: -7});
When I click on startDate input text box I do see datepicker control with
highlighted current date.
However the startDate textbox is still empty.
How can I add startdate that was highlighted in datepicker as default value
and apply that as date displayed in textbox(i.e. 4/23/2008) ?

I tried using following but it returns null :
alert(jQuery('#startDate').datepicker("getDate"));

Thanks in advance,
Amit



-- 
Know that you are special but be ordinary. -Sri Sri Ravisankar


[jQuery] PHP and ajaxForm submit generates duplicate HTML!

2008-02-05 Thread Amit

First, here is my code for test.php file. It has a form with 2 text
fields. Once submitted it adds a record to database and gives a
message "1 record added." in a div "message" :








$(document).ready(function() {

$('#form1').ajaxForm({
target: '#message', success: function(){$
('#message').fadeIn('slow');}
});
});



















The problem is, every time I add a new record the message div fills up
with a new line "1 record added." and if I check the source code,
inside "message' there is another "message" created. So if I add 10
records, original "message" div fills up with 10 more same div and
therefore 10 lines of  "1 record added.". Eventually the file size
increases. How do I solve this problem? I'm new to JQuery. Please help!


[jQuery] Re: which query is most efficient?

2007-12-04 Thread Amit Uchat
Benjamin,
very good way to explain complex information. I would look forward to hear
more on your website.

On Dec 4, 2007 8:23 PM, Benjamin Sterling <[EMAIL PROTECTED]>
wrote:

> Dave, I know I am getting in here late, but I did a post on fast selectors
> that may point you in the right direction: 
> http://benjaminsterling.com/jquery-what-are-the-fastest-selector/
>
>
>
> On 12/4/07, Flesler <[EMAIL PROTECTED]> wrote:
> >
> >
> > There is, it's called slick speed.
> >
> > Ariel Flesler
> >
> > On 4 dic, 19:48, "Glen Lipka" <[EMAIL PROTECTED]> wrote:
> > > This would make a great page.  Put two selectors in and see which one
> > is
> > > faster.
> > > Glen
> > >
> > > On Dec 4, 2007 10:29 AM, sawmac <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > >
> > >
> > >
> > > > > $('p span'): 863ms
> > > > > $('p').find('span'): 3050ms
> > >
> > > > Wow, that's a big difference.
> > > > Thanks Eric for running this test and thanks Gordon for pointing me
> > to
> > > > the Firebug profiler
> > >
> > > > cheers
> > >
> > > > --dave- Ocultar texto de la cita -
> > >
> > > - Mostrar texto de la cita -
> >
>
>
>
> --
> Benjamin Sterling
> http://www.KenzoMedia.com 
> http://www.KenzoHosting.com 
> http://www.benjaminsterling.com




-- 
Know that you are special but be ordinary. -Sri Sri Ravisankar


[jQuery] Re: jQuery improving performance

2007-12-03 Thread Amit Uchat
thank you all for quick and quality replys...
I am re-writing my script to accomodate new suggestions.
and profile my function again to check any improvement.

Thanks,
Amit

On Dec 3, 2007 10:36 AM, Dave Methvin <[EMAIL PROTECTED]> wrote:

>
>
> > I want to improve performance for following snipet when run for 1000
> times.
> >
> > jQuery(".Grid_Item,.Grid_AltItem").each( function() { //begin for-each
> TR
> > id = jQuery(this).find(".IdCell").text();
> > foo = jQuery(this).find("#foo").val();
> > bar = jQuery(this).find("#bar").val();
> > });
>
> Since there is no document.getElementsByClassName, that selector is
> going to take two complete passes through the entire document to get
> the two classes, then join the two result sets together. Since you are
> dropping into an .each() anyway, you might as well just get all TR
> elements and filter them yourself.
>
> The other uses of the jQuery selectors inside the .each() can be
> replaced by using the childNodes array of the TR directly.
>
> jQuery("#myTable tr").each( function() {
>   if ( !/Grid_Item|Grid_AltItem/.test(this.className) )
>  return;
>   var kids = this.childNodes;
>   var Id = jQuery(kids[2]).text();
>   var foo = kids[8].firstChild.value;
>   var bar = kids[9].firstChild.value;
>   
> });
>
> For fastest operation, you can substitute this for the Id line:
>
>   var Id = kids[2].textContent || kids[2].innerText;
>
> All of these optimizations only work if you guarantee that the table
> is laid out strictly as you specified. Otherwise you'll need to insert
> a bunch of error checks to make sure you don't follow empty firstChild
> objects etc.
>



-- 
Know that you are special but be ordinary. -Sri Sri Ravisankar