Removing text with jQuery (Hard? or Simple?) Example within..
I have got a php page that grabs specific cell data from my google spreadsheet.
The problem is that google decides to echo back the cell data in the worst way possible.
If I request C8 I get string(2) "23" as a response instead of just 23.
This happens 25~ times depending on how many cells I request - how can I use jQuery to remove ALL cases of string(2) or string(whatever) and perhaps the quotes as well.
Right now I'm stuck with garbage like <p class="cellone">string(2) "43"</p>
I'm looking to turn them all into <p class="cellone">43</p> etc.
Is there a relatively simple way to remove all this garbage string related text?
s = 'string(2) "43"';
alert(s.replace(/string\(\d+\) "(\d+)"/, "$1"));
At least 98% of internet users' DNA is identical to that of chimpanzees
Can always count on the Borg , I'll give that a shot today. Much appreciated.
I'm generating the cell results as part of a function like so (php inside of my jquery-based page)
echo "<p class=\"cellone\">Label: ";
etc, if I wanted to do this on all results what am I missing? Your idea makes sense but how would I define this query as a variable to be able to perform that kind of a string replace?
Sorry for the noobyness, I assure you in ten years I'll be much better
Last edited by Sodascript; 10-06-2010 at 08:54 AM.
All problems solved, lesson learned. Thanks again Fang.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)