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...)

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 11-29-2009, 02:31 AM
    joflo joflo is offline
    Registered User
     
    Join Date: May 2008
    Posts: 13
    jQuery: cross-domain json error

    Hi,

    I've been pulling my hair out with this one.
    Code:
    $.getJSON(
    	url,
    	{data:data},
    	receive
    );
    That works when querying the same domain. However I can't find a solution which works across domains that doesn't give me one of the following two errors: (Firebug)

    - "invalid label"
    - "Access to restricted URI denied code:1012"

    Also in what I've read, there was mention that jQuery for cross-domain JSON parsing is not secure.

    It shouldn't need more than a few lines of code? Either way I'm at a bit of a loss.

    Thanks
    Reply With Quote
      #2  
    Old 11-29-2009, 08:59 PM
    A1ien51's Avatar
    A1ien51 A1ien51 is offline
    Ajax Author
     
    Join Date: May 2003
    Location: Between Baltimore and DC
    Posts: 3,403
    You have to include a JSONP parameter which the external site will include in the page.

    JSONP creates a function and wraps it around the JSON object.

    Docs explain it: http://docs.jquery.com/Ajax/jQuery.getJSON


    Eric
    __________________
    Tech Author [Ajax In Action, javascript: Visual Blueprint] | twitter | linkedin | http://www.pascarello.com
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    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 04:15 PM.



    Acceptable Use Policy


    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.