473,574 Members | 17,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

String is automatically getting truncated

Hi

In my code, one string variable is subjected to contain more amount of
characters. If it cross certain limit, the string content in the
varabile is automatically getting truncated and i am not getting the
full data.

Is there any max limit for an variable to store in javascript?

Can anyone please help me to solve this prob?

--
Mani

Aug 28 '06 #1
4 4485
R.Manikandan wrote:
In my code, one string variable is subjected to contain
more amount of characters. If it cross certain limit, the
string content in the varabile is automatically getting
truncated and i am not getting the full data.
At least that is the interpretation you are placing on the evidence that
you are keeping to yourself.
Is there any max limit for an variable to store in
javascript?
For string primitives no practical limit less than OS available memory
has been identified. No restrictions are stated in the specification.
Can anyone please help me to solve this prob?
Probably, but not without information.

Richard.
Aug 28 '06 #2
Richard Cornford wrote:
R.Manikandan wrote:
In my code, one string variable is subjected to contain
more amount of characters. If it cross certain limit, the
string content in the varabile is automatically getting
truncated and i am not getting the full data.

At least that is the interpretation you are placing on the evidence that
you are keeping to yourself.
Is there any max limit for an variable to store in
javascript?

For string primitives no practical limit less than OS available memory
has been identified. No restrictions are stated in the specification.
Can anyone please help me to solve this prob?

Probably, but not without information.

Richard.
Richard,

Sorry. I didnt express the issue properly.

I am getting the data from database in php and generating a combo box
by using it, which i got thourgh ajax in my code. I am using xml based
response and the variable used to get the child node value is not
capable of holding all the content and it is getting truncated.

Here is my code...

response = http_request.re sponseXML;
var items = response.getEle mentsByTagName( "movienames ");
if(items!=null && items.length!=0 )
{
for(var i=0; i<items.length ; i++) {
mvnamestr =
items[i].getElementsByT agName("mvnames tr")[0].childNodes[0].nodeValue;
mvnameid =
items[i].getElementsByT agName("mvnamei d")[0].childNodes[0].nodeValue;
theanamestr =
items[i].getElementsByT agName("theatre namestr")[0].childNodes[0].nodeValue;
theaidstr =
items[i].getElementsByT agName("theatre idstr")[0].childNodes[0].nodeValue;
}

The
"items[i].getElementsByT agName("mvnames tr")[0].childNodes[0].nodeValue"
itself is not holding the entire content, but the variable what i am
passing from php is having the full data.

So automatically my variable "mvnamestr" wont have the full data.

I request to kindly teach me, if i haven't expressed the issue propely.

--
Mani

Aug 29 '06 #3
R.Manikandan wrote:
Richard Cornford wrote:
>R.Manikandan wrote:
>>In my code, one string variable is subjected to contain
more amount of characters. If it cross certain limit, the
string content in the varabile is automatically getting
truncated and i am not getting the full data.
<snip>
Sorry. I didnt express the issue properly.

I am getting the data from database in php and generating a
combo box by using it, which i got thourgh ajax in my code.
I am using xml based response and the variable used to get
the child node value is not capable of holding all the content
and it is getting truncated.
<snip>
mvnamestr =
items[i].getElementsByT agName("mvnames tr")[0].childNodes[0].nodeValue;
<snip>
"items[i].getElementsByT agName("mvnames tr")[0].childNodes[0].nodeValue"
itself is not holding the entire content, but the variable what i am
passing from php is having the full data.
<snip>

So your issue has nothing what so ever to do with string variables but
is instead about the capacity of text nodes in an XML DOM.
Mozilla/Firefox/Gecko XML DOMs do have a capacity limit on the text
nodes, but they do represent all of the data in the XML source by
splitting it across multiple text nodes. So the rest of your data is in
childNodes 1 to N.

You either need to loop through the text node children of an element
and accumulate all the data into a string, or possibly call the -
normalise - method of the element so that adjacent text nodes are
amalgamated.

Richard.

Aug 29 '06 #4

Richard Cornford wrote:
R.Manikandan wrote:
Richard Cornford wrote:
R.Manikandan wrote:
In my code, one string variable is subjected to contain
more amount of characters. If it cross certain limit, the
string content in the varabile is automatically getting
truncated and i am not getting the full data.
<snip>
Sorry. I didnt express the issue properly.

I am getting the data from database in php and generating a
combo box by using it, which i got thourgh ajax in my code.
I am using xml based response and the variable used to get
the child node value is not capable of holding all the content
and it is getting truncated.
<snip>
mvnamestr =
Richard,

Thnks a lot. I am having some more doubts in the following code:

response = http_request.re sponseXML;
var items = response.getEle mentsByTagName( "movienames ");
if(items!=null && items.length!=0 )
{
for(var i=0; i< items.length; i++) {
mvnamestr =
items[i].getElementsByT agName("mvnames tr")[0].childNodes[0].nodeValue;
mvnameid =
items[i].getElementsByT agName("mvnamei d")[0].childNodes[0].nodeValue;
theanamestr =
items[i].getElementsByT agName("theatre namestr")[0].childNodes[0].nodeValue;
theaidstr =
items[i].getElementsByT agName("theatre idstr")[0].childNodes[0].nodeValue;
}
}

I used the above code [ got from Google ] to parse the xml doc.

When i alert the variable "items.leng th", i am getting 1 as output in
mozilla, but 0 ( zero ) in IE...dont knw the reason for this..

Can you explain why this happens?

Can you give me some notes regarding how to parse the xml document and
what are the things to be taken care while doing these type of code?

--
Mani

Aug 30 '06 #5

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

Similar topics

1
1786
by: Ralph Freshour | last post by:
I have a form where the user can enter text - I noticed that if I enter a sentence like: That is what I'm thinking that when I save that string into a php global session variable, when I use that same variable in the next form the string is: That is what I
1
2027
by: Bill | last post by:
I'm submitting data through a form with multiple rows on it, that goes out to a processing page, which then scrolls through the data row by row and sends it into a database table. It is truncating one of the strings, the book tile string, so that if there are three words in it, only the first is getting submitted to the table. I have a...
1
4288
by: Francesco Moi | last post by:
Hello We've got a string field with some words, and I created a form so that anybody could search someting into this field. SELECT * FROM customer_table WHERE description LIKE '%query%'"; But if you search '100', it returns '45,100'. Or if you get 'plugged', it reurns 'unplugged'.
6
2646
by: Al | last post by:
Hi I need to get the IP address of a computer on the network that uses dynamic IP addressing. Is there anyway I get the address but providing the name of the computer? Thanks in advance Al
5
1542
by: Bryan Dickerson | last post by:
I'm still struggling with this XML stuff. I've gotten this far: oSR = New System.IO.StringReader(oC.GetAllContacts(txCICust.Text, txCIType.Text)) oXML.LoadXml(oSR.ReadToEnd) sStr = "Found Contact Name: ".Concat(oXML.DocumentElement.SelectNodes("/Table/CI_NAME").Item(0).Value()) .... but I get an error on the LoadXml method that says:...
2
2031
by: bil.shah | last post by:
Hi, I am listening to a port for data but I am not able to recieve whole data, I only get truncated data. Client sends me data that exceeds 40K and the data I recieve in my callback function is always 8K to 9K. I dont get the rest of the data. I think the data size is too big to come in one go and hence it comes in 2-3 sub-packages but my...
1
8765
by: Kuldeep | last post by:
When i export data from MySQL(server 5.0) i get followng error. SQLSTATE: 01004 String data, right truncated can sombody explain why this is happenning and possible solution!!! consider it as a bit urgent!!!
1
8138
by: Veeru71 | last post by:
When I am SELECT'ing a CLOB column from command prompt, the output is getting truncated after a certail limit (8 K ??) How do I get the full data out of a CLOB column? Are there any string manipuration functions for CLOB fields to read it in multiple chunks ? Thanks in advance.
1
2937
by: stanlopilolo | last post by:
Here, I have a string inside a static method. Something like "4.0+5.0i" and I want to parse it, to -at the end of the day-get a complex number 4+5i How exactly can I get to this? Spliting d spring into string arrays, then to double, using Double.parseDouble? then .... Please I'm new to programming, and don't want to lose my mind figuring...
0
7820
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8081
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7835
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6486
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5635
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5325
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3777
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2255
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1360
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.