473,322 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

extra newlines in Ajax responseText added by PHP include

I have a simple PHP script that sends a string to
XMLHttpRequestObject.responseText.
responseText as received from the PHP script begins with 2 extra
newline characters (\n\nMyString):

<?php
require_once('DB.php');
require_once('../myDir/myFile.php');
.......
echo('MyString');
?>

myFile.php
<?php
$var1 = 1;
$var2 = 2;
$var3 = 3;
?>

If I manually write the contents of myFile.php into the script, there
are no extra newlines in responseText. (Same behavior with IE/FireFox)
Am I missing something?
Thanks!
Andrew

Nov 12 '06 #1
1 1870
Hi,

ab****@yahoo.com wrote:
I have a simple PHP script that sends a string to
XMLHttpRequestObject.responseText.
responseText as received from the PHP script begins with 2 extra
newline characters (\n\nMyString):

<?php
require_once('DB.php');
require_once('../myDir/myFile.php');
......
echo('MyString');
?>

myFile.php
<?php
$var1 = 1;
$var2 = 2;
$var3 = 3;
?>

If I manually write the contents of myFile.php into the script, there
are no extra newlines in responseText. (Same behavior with IE/FireFox)
Am I missing something?
Thanks!
Andrew
Seems to me that it's not a JavaScript problem, but a PHP problem. I
recommend you to post to the appropriate group.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Frances | last post by:
I literally started learning AJAX just last weekend.. I have this page, http://www.francesdelrio.com/ajax/db2.html, where I'm essentially doing what's here,...
9
by: GTi | last post by:
I have a bizare Ajax POST problem. I use Ajax POST to send data to the server. The server get the POST and answer back. BUT if I POST the data once again I recieve the same answer that the first...
1
by: abrtlt | last post by:
I have a simple PHP script that outputs a string requested by an Ajax page. XMLHttpRequestObject.responseText as received from the PHP script begins with 2 extra newline characters (\n\nMyString):...
1
by: geevaa | last post by:
http://www.phpbuilder.com/columns/kassemi20050606.php3 XMLHttpRequest and AJAX for PHP programmers James Kassemi Introduction: Although the concept isn't entirely new, XMLHttpRequest...
4
by: -Lost | last post by:
For example: var newlines = 'a\n\nb\n\nc'; alert(newlines); Yet, if I get that *exact* same line from an XMLHttpRequest's responseText, it is always alerted as: a\n\nb\n\nc
6
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
21
by: Leena P | last post by:
i want to basically take some information for the product and let the user enter the the material required to make this product 1.first page test.php which takes product code and displays...
5
by: thatcollegeguy | last post by:
Below are my 3php and 2js files. I create a table using ajax/php and then want to change the values in the tables add(+ number for teamid) id's for each specific td in the table. I don't know...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.