Results 1 to 4 of 4

Thread: oh! my god. SyntaxError: Parse error javascript

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Angry oh! my god. SyntaxError: Parse error javascript

    i am used qt 4.8 .

    i when load a page javascript in qwebview error parser error give me.

    old code with parser error.
    Qt Code:
    1. setRequestHeaders: function() {
    2. var headers = {
    3. 'X-Requested-With': 'XMLHttpRequest',
    4. 'X-Prototype-Version': Prototype.Version,
    5. 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
    6. };
    7.  
    8. if (this.method == 'post') {
    9. headers['Content-type'] = this.options.contentType +
    10. (this.options.encoding ? '; charset=' + this.options.encoding : '');
    11.  
    12. /* Force "Connection: close" for older Mozilla browsers to work
    13.   * around a bug where XMLHttpRequest sends an incorrect
    14.   * Content-length header. See Mozilla Bugzilla #246651.
    15.   */
    16. if (this.transport.overrideMimeType &&
    17. (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
    18. headers['Connection'] = 'close';
    19. }
    To copy to clipboard, switch view to plain text mode 

    new code with not parser error.

    Qt Code:
    1. setRequestHeaders: function() {
    2. var headers = {
    3. 'X-Requested-With': 'XMLHttpRequest',
    4. 'X-Prototype-Version': Prototype.Version,
    5. 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
    6. };
    7.  
    8. if (this.method == 'post') {
    9. headers['Content-type'] = this.options.contentType +
    10. (this.options.encoding ? '; charset=' + this.options.encoding : '');
    11.  
    12.  
    13. if (this.transport.overrideMimeType &&
    14. (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
    15. headers['Connection'] = 'close';
    16. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by ali_esfahan; 28th November 2012 at 08:06.

Similar Threads

  1. QtXml parse error at line 1 column line 1
    By vinod sharma in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 8th September 2012, 05:02
  2. Replies: 1
    Last Post: 11th May 2012, 18:08
  3. Replies: 9
    Last Post: 29th November 2010, 12:12
  4. QtWebkit and JavaScript error messages
    By Diph in forum Qt Programming
    Replies: 1
    Last Post: 29th April 2009, 11:10
  5. qmake parse Error
    By mka in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2007, 08:02

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.