Tagged Questions
-1
votes
3answers
39 views
How can I use substring to print delimited string
How can I print the first few characters of a delimited string by using substring()
var txt="AB:CD:EF:GH:IJ:KL:MN:OP";
document.write(txt.substring(3));
0
votes
2answers
39 views
Javascript: How to delete duplicate lines from string
How to write a script in javascript which check all lines ("Line1\nLine2\nLine3...") in a string and if there is duplicate line then just leave one and ignore br tags ??
var s = "Hello ...
0
votes
2answers
24 views
Javascript — call to string.search(/regex/) occaisionally crashes program
I'm writing a native javascript app for android, and it involves a short regex call. The following function should select the inner string from a block of html, shorten it if it's too long, then add ...
1
vote
1answer
45 views
send html code when using onclick()
I'm getting syntax error when using this code:
$('#column1').append('<span class="link_style"><a href="#" onClick="show_text(' + new_cities[i][j].content + ')"></a></span>');
...
2
votes
1answer
36 views
ASP.NET JavaScript slash symbol escaping
I'm working on ASP.NET project. And there is a one issue, which doesn't allow me to make a good webpage view.
There is a piece of code:
alertPanel.innerHTML = "some text<br />";
When I've ...
4
votes
4answers
44 views
javascript comparison of strings
I have the following script
document.write("12" < "2");
which returns true. Any reason why? The documentation says that javascript compares strings numerically but, I don't see how "12" is less ...
0
votes
0answers
74 views
Find section of string in variable
Following on from this question:
Select first complete string matching partial string
I am storing an external sites html in a variable. I want to search that variable for the 4th copy of 'Was it ...
5
votes
4answers
59 views
Tokenize string with space seperated values unless values are wrapped in single quotes.
can any body tell me to split a string in java script with space which is not within single quote.
Like if string is
"0 60 120 180 'node name' 2 34 45 12"
then it will tokenize such that
...
0
votes
2answers
49 views
Process folder path and handle trailing slash in a single line?
This code accepts a path/to/folder or a path/to/folder/ (notice the trailing slash) and extracts the name of the last folder in the string, i.e.:
path = 'path/to/folder'.split('/');
folder = ...
1
vote
4answers
62 views
Make all relative path URLs in images full paths using PHP, javascript or jQuery
I want to take any url on a page, mainly for the sake of fixing images that aren't displaying, and change it from relative to absolute, if it's relative.
Example:
From <img ...
0
votes
1answer
57 views
Get text file content using javascript
I've tried use javascript to open text file and get his name and his content, so right now I'm stuck at string, because I used input - type file to get directory / path.
Anyway, my question what is ...
0
votes
4answers
38 views
Print a string one character at a time with timed intervals in JavaScript [duplicate]
I want to create the effect where you can see the text being written out on the screen; I want to achieve this by printing one character at a time. I have successfully been able to print one character ...
1
vote
1answer
45 views
Generate random string and check into databse for non repetation
In MVC-3 (Razor Engine) : I want to generate random string on a button click called NextAvailable, but condition is that before generation of random string look into SQL database that it is already ...
2
votes
2answers
45 views
JavaScript String subclassing issue
I'm working on a simple browser mud-client, and i need to provide some basic functions to string processing. So, when some user casts a mass spell, it should be collapsed into a one string, i.e. CAST: ...
0
votes
1answer
20 views
Parameter starting with a zero digit not pass correctly to JavaScript function
I'm trying to pass a parameter to a function in JavaScript.
My function code for example:
function loadbigimage(parm){
and I'm calling with:
<a href='javascript:;' ...