Syntax error with Ajax file reading

This is a discussion on "Syntax error with Ajax file reading" within the JavaScript Forum section. This forum, and the thread "Syntax error with Ajax file reading are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 12th, 2007, 16:48
Junior Member
Join Date: Jul 2007
Location: West Midlands
Age: 26
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Syntax error with Ajax file reading

Hey guys,
Hope one of you lot can solve this one for me as its giving me a headache and javascript rarely does that..

I keep receiving this error message in good old firefox

Quote:
Error: syntax error
Source File: http://www.paramiliarclients.com/cli...entry.php?id=2
Line: 1, Column: 1
Source Code:
3|First Name|Last Name|This is my address~and this is the 2nd line~and a 3rd line|TF107RE|0111111|1111111123343^
Now I am using an AJAX function to read the content from a dynamic file and even tho it works I still get that error message....

The php file simply has that Source Code as a text output so no code in that file and the ajax function is as follows

Code: Select all
function xmlhttpGet(strURL, strGetParams, strResultFunc){
    var xmlHttpReq = false;
    if (window.XMLHttpRequest) {
        xmlHttpReq = new XMLHttpRequest();
        xmlHttpReq.overrideMimeType('text/xml');
    }
    // IE
    else if (window.ActiveXObject) {
        xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }

    strGetURL = strURL + "?" + strGetParams;
    xmlHttpReq.open('GET', strGetURL, true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHttpReq.onreadystatechange = function() {
        if (xmlHttpReq.readyState == 4) {
            TEMP = "strResultFunc" + "('" + xmlHttpReq.responseText + "');";
            eval(TEMP);
        }
    }
    xmlHttpReq.send(null);
}
Oh and btw dont try to view the files as it will ask you to login and it is WWAAAAYYYY to much agro to setup a temp user with permissions to just this client.
Reply With Quote

Reply

Tags
ajax, httpopen, javascript, open

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
reading a log file one line at a time depending on timestamp eon201 PHP Forum 1 Dec 4th, 2007 05:54
[SOLVED] Reading as text file backwards eon201 PHP Forum 4 Nov 8th, 2007 10:53
syntax error... ktsirig Databases 2 Feb 4th, 2007 14:48
Annoying little syntax error adeking Web Page Design 4 Aug 9th, 2006 13:50
error in SQL syntax Drgreenfingers Databases 10 Jan 30th, 2006 02:00


All times are GMT. The time now is 10:36.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43