Search Results

Search found 10 results on 1 pages for 'zhami'.

Page 1/1 | 1 

  • jQuery.ajax call to Twitter succeeds but returns null for Firefox

    - by Zhami
    I've got code that makes a simple get request to Twitter (search) using jQuery's ajax method. The code works fine on Safari, but fails on Firefox (3.6.3). In the Firefox case, my jQuery.ajax parameters 'success' method is invoked, but the supplied data is null. (In Safari, I receive a boatload of JSON data). My ajax call is: $.ajax({ url: 'http://search.twitter.com/search.json?q='+searchTerm, dataType: 'json', async: true, beforeSend: function(request) { window.console.log('starting AJAX request to get Twitter data'); }, success: function(data, textStatus, request) { window.console.log('AJAX request to get Twitter succeeded: status=' + textStatus); callback(data); }, error: function(request, status, error) { window.console.log('AJAX request to get user data --> Error: ' + status); errback(request, status, error); } }); Firebug shows Response headers: Date Sun, 11 Apr 2010 22:30:26 GMT Server hi Status 200 OK X-Served-From b021 X-Runtime 0.23841 Content-Type application/json; charset=utf-8 X-Served-By sjc1o024.prod.twitter.com X-Timeline-Cache-Hit Miss Cache-Control max-age=15, must-revalidate, max-age=300 Expires Sun, 11 Apr 2010 22:35:26 GMT Vary Accept-Encoding X-Varnish 1827846877 Age 0 Via 1.1 varnish X-Cache-Svr sjc1o024.prod.twitter.com X-Cache MISS Content-Encoding gzip Content-Length 2126 Connection close The HTTP status is OK (200), the Conetnt-Type is properly application/json, and the Content-Length of 2126 (gzip'd) implies data came back. Yet Firebug shows the Response to be empty, and a test of the supplied data shows it o be 'null.' I am aware of a similar post on Stack Overflow: http://stackoverflow.com/questions/1188976/jquery-get-function-succeeds-with-200-but-returns-no-content-in-firefox and from that would assume this problem is possibly related to cross-domain security, but... I know there are many JS widgets and whatnots that ajax get data from Twitter. Is there something I need to enable to allow this?

    Read the article

  • "not well-formed" warning when loading client-side JSON in Firefox via jQuery.ajax

    - by Zhami
    I am using jQuery's ajax method to acquire a static JSON file. The data is loaded from the local file system, hence there is no server, so I can't change the mime type. This works fin in Safari, but Firefox (3.6.3) reports the file to be "not well-formed". I am aware of, and have reviewed, a similar post here on Stack Overflow: http://stackoverflow.com/questions/677902/not-well-formed-error-in-firefox-when-loading-json-file-with-xmlhttprequest I believe my JSON is well-formed: { "_": ["appl", "goog", "yhoo", "vz", "t"] } My ajax call is straightforward: $.ajax({ url: 'data/tickers.json', dataType: 'json', async: true, data: null, success: function(data, textStatus, request) { callback(data); } }); If I wrap the JSON with a document tag: <document>JSON data</document> as was mentioned in the above referenced posted question, the ajax call fails with a parserror. So: is there a way to avoid the Firefox warning when reading in client-side JSON files?

    Read the article

  • JSLint reports "Unexpected dangling" character in an underscore prefixed variable name

    - by Zhami
    I know that some people consider the presence of a leading underscore to imply that a variable is "private," that such privacy is a fiction, and assume this is why JSLint reports such names with an error message. I use Google Analytics on a Web site I am building. I make reference to GA's variables, such as "_gaq." I am trying to get my JS code to be 100% JSLint clean (I'm not religious about my coding style, and so will go with Mr. Crockford's counsel). That said, I can't do anything about Google's variables names... so, I guess I can't get 100% "clean." I post here in case I've misunderstood the message, and can do something to comply with JSLint practices.

    Read the article

  • Having trouble using jQuery to set meta tag values

    - by Zhami
    I'm trying to set meta tags using jQuery (please don't reply that this doesn't make sense since search engines blah-blah-blah... I am loading invoking 3rd party Javascript functions that examine these vales, such as Tweetmeme and Facebook). If I use: $('meta[name=some-name]').attr('content', 'some value'); it does work to set the value of an existing meta tag, but does not create a meta tag if such a named one does not exist. If you have insight or experience with this, please reply...

    Read the article

  • Resource interpreted as other but transferred with MIME type text/html.

    - by Zhami
    I'm transferring fragments of HTML via Ajax. Safari (4.0.5) reports: "Resource interpreted as other but transferred with MIME type text/html." The file name of the file I get has a .html extension. The server does set the header for this: Content-Type:text/html As I said, the content is a fragment of HTML, which is injected into the page (with jQuery). The contents of the file look like: <html> ... some valid html ... </html> What else might Safari need to see to make it interpret the received content as HTML? TIA.

    Read the article

  • JSLint reports unexpected use of '&' and '|' -- I'd like to clean this

    - by Zhami
    I'm trying to get my Javascript code 100% JSLint clean. I've got some JS code that I've lifted from elsewhere to create a UUID. That code has the following line: s[16] = hexDigits.substr((s[16] & 0x3) | 0x8, 1); This line incites JSLint to generate two error messages: 1) Unexpected use of '&' 2) Unexpected use of '|' I don't understand why -- I'd appreciate counsel regarding how to recode to eliminate the error message.

    Read the article

  • Facebook like iframe ignores my specified href

    - by Zhami
    I have Javascript that imputes (computes and injects) HTML into my DOM for the Facebook "Like" function. I need to specify a "canonical" URL because the actual URL doesn't reflect all the DOM manipulations that have been made (driven by user activity on the Web "page"). Alas, Facebook's code doesn't use the url I supply but the window.location value (which has #hash aspects that influence the page's presentation, but that aren't accessible to the server). Anyway... why is FB's code ignoring the url I give to it? I generate the HTML thus: var html = '<iframe src="http://www.facebook.com/plugins/like.php?href=' + encodeURI(url) + '&layout=standard&show_faces=false&width=100&action=recommend&font=arial&colorscheme=light" style="border:none; overflow:hidden; width:270px; height:26px;" allowTransparency="true" frameborder="0" scrolling="no"</iframe'

    Read the article

  • Can I access the function body of an event listener using nodeJS jsdom

    - by Zhami
    I am using jsdom with nodeJS. I load in a large HTML document, and am using jQuery to navigate the DOM. I have a case where I have an element, and I need to access the function body of an event listener (onclick). The event listener was added in the source HTML: <a href="#" onclick="javascript:window.open('http://<rest-of-url>'); return false;"></a> The onclick attribute of the DOM element is undefined. btw: what I really want to do is get the URL (please note that <rest-of-url> is not what is in the source, a real URL spec is there) that is specified in the source.

    Read the article

  • jquery document height reported incorrectly by IE (on XP) first time

    - by Zhami
    I'm having a "first time" problem with IE, which reports a different value for $(document).height(); when the page first loads versus subsequent queries. The difference is 17 pixels regardless of the opening size of the window -- on document ready, the height reported is 17 pixels larger than is subsequently reported. I wonder if this is an artifact of some aspect of my page (some margins or paddings somewhere), but so far can't account for 17 pixels.

    Read the article

1