www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > JavaScript

    JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...)

     
     
    Thread Tools Rate Thread Display Modes
    Prev Previous Post   Next Post Next
      #1  
    Old 02-17-2010, 09:22 AM
    trufles trufles is offline
    Registered User
     
    Join Date: Feb 2010
    Posts: 1
    Internet Explorer choking on input inside ajax

    Hi,

    I have a function that uses jQuery.load() to call in 3 snippets of forms from different pages and then on the success text status it tries to load a colour picker:

    Code:
    $(document).ready(function() {
    
        function ajax_form(putloadingboxhere, putsnippethere, snippeturl) {
    
            $(putsnippethere).load(snippeturl, function (responseText, textStatus, XMLHttpRequest ) {
                if (textStatus == "success") {
                    alert('One')
                    $("input.pickcolor").ColorPicker({
                        onShow: function (colpkr) {
                            $(colpkr).fadeIn(500);
                            return false;
                        },
                        onSubmit: function(hsb, hex, rgb, el) {
                            $(el).val(hex);
                            $(el).ColorPickerHide();
                            $(el).siblings('.colorpreview').css('background-color', '#' + hex);
                        },
                        onBeforeShow: function () {
                            $(this).ColorPickerSetColor(this.value);
                        }
                    })
                    .bind('keyup', function(){
                        $(this).ColorPickerSetColor(this.value);
                    });  
    
                    alert('Two')
                }
                if (textStatus == "error") {
                    // Show error message
                }
            });
        }
    
        ajax_form('tab_box', '#formone', 'snippet_one.htm #snippet');
        ajax_form('tab_box', '#formtwo', 'snippet_two_copy.htm #snippet');
        ajax_form('tab_box', '#formthree', 'snippet_three.htm #snippet');
    });
    It works fine in Firefox and Safari but (surprise, surprise) IE has a problem with it. I have added an alert to see what is going on before and after one of the functions.

    FF & Safari & IE8: Alert 'one' and Alert 'two' appear three times as expected and colour picker appears. IE6 & 7: Alert 'one' shows three times and colour picker does not appear.

    IE throws this error after every alert: 'Error: Object doesn't support this property or method.' is:

    $('input.pickcolor').ColorPicker

    The input boxes are in a form that are brought in via the ajax but it doesn't work if they are native to the page either.

    It works if the ajax is not involved and the input fields are on the page but because I need to test if the ajax was successful before I run the colorpicker stuff it needs to be inside the ajax.

    Any help would be great! Cheers.
    Reply With Quote
     

    Bookmarks

    Tags
    ajax, javascript, jquery


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 01:25 PM.



    Acceptable Use Policy

    Internet.com
    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.