I'm trying to make this tool for some fellow librarians who answer questions via text messaging. As you see beneath that page's text box, the catch is that the PC-to-SMS client treats the forward slash as two characters.
I'd like if possible for the JavaScript character counter to recognize slashes and automatically add 'two' to the character count, instead of just one, for each forward slash.
(BTW the reason for 155 instead of 160 is that the client adds a shortcode to our outgoing texts.)
I am trying to figure out if it is possible to add properties (or tie another variable) to a variable string? I believe it is limited to objects. I'll show you the code to help clarify what I am getting at:
function toggleKml(theKML) { if (theKML.toggleState == 1) { map.removeOverlay(theKML);
I am building a string inside a variable prior to printing it on screen as follows : myclock += hours+':'+minutes; where "hours" and "minutes" are variables initialised elsewhere. How can I add a carriage return or new line character to the end of this line, so that anything else cocatenated to this variable is displayed on the next line.
i got this javascript-function that changes the entries of a selectbo depending from the selection of another selectbox:
function changeBezug(selectedEntry, '$exhibits', .....) {}
the string '$exhibits' holds all the entries for the option Entry i the first selectbox; Unfortunately i get javascript error unterminated string literal an the error pointer points at the first apostroph: function changeBezug(selectedEntry, '
I tried replacing all special chars in $exhibits, even putting th string directly into the function code with php and tried using quote instead..
Now im out of ideas! Maybe im using the wrong replacement for the apostroph... i use ' is that wrong? i also tried ' to no good either.. what's the right one?
Im using a vb script that will show the latest x forum threads on forumhome but i would like to be able to restrict how many characters it out puts so after say 150 chars then the 3 dots would appear.ie. This would be my forum thread ti ...Heres the script im using
<if condition="$vbulletin->options['externaljs']"> <!-- show latest active threads --> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0"
I need to match two strings that have the same content, but out of order.
For example "hi, my name is will"
and "will hi, name is my"
So, in this case how do i check to see that everything in the top matches everything in the bottom?
Lets take this a step further. I ran into the problem that if the strings have quotes " they mess up. So i couldn't match id="yay" even though it was part of the string.
I tried to escape it , but for some reason it was escaped as %3D%quot%22% and the other similar string with quotes esacped as %3B%.
I'm trying to write a function that takes a word and adds a space between each letter e.g space becomes s p a c e. I have written below but when I call the function it says the argument is not defined.
Code: function insertSpaces(string){ var currentCharacter; var resultString; resultString = '' //a line to loop through each charcther in the string agument for (var position = 0; position < string.length; position = position + 1){ // set current characther as the first charcter in the string and add a space currentCharacter = (string.charAt(position) + ' ') //store the currentcharcter and add followng characthers resultString = currentCharacter + resultString } return resultString }
is there a way to prevent user from adding more characters into a text input based on a validation rule(eg. you entered more than n words, you can't enter more, but you can delete or edit)? I think I'll have to programmatically delete the extra letter(s) that user just input somehow if the addition causes a violation of the rule, is this the best way?
I have a question if it is possible to manipulate the settings of character encoding in Ms Internet Explorer 5.0, 5.5 and 6.0. The problem is that the default instalation of Ms IE seems to have hard selected default encoding to "Western European (ISO)", which means iso-8859-1. When browsing pages with some Central/Eastern European characters these are converted to iso-8859-1 so displayed wrong.
I would suppose the "auto-select" option should be default, so the browser can select the right encoding according to the meta-tags in the head of webpage. But this is apparently not true.
Please, is it possible to use JavaScript or Java applet to get the information about the current client character encoding settings and/or change it to the "auto-select" value ? How to do this ?
In IE, it looks like you can have to many characters in a javascript function.
The content of an entire html page is put into this function...
function updateTemplate(content) { content=content.replace(/'/g, '''); content=content.replace(/"/g, '"'); content=content.replace(/</g, '<'); content=content.replace(/>/g, '>'); Element.update('template',content); } it seems to cut off the content after about 2060 characters. is that an IE thing or is there something wrong with my code. FF does it fine...
I have a custom object named #cdata-section, however I am unable to access this object and get a run time "Illegal Character" javascript error. my object looks like this:
data.news.story[i].body.#cdata-section
The pound sign is causing problems. How can I use this object in my javascript source? Right now I'm trying something like this to escape the pound sign:
I've been looking at this for a while now and I just can't get my head around it. What i need to do is put together a program which allows the user to type in a sequence of letters and then tells the user how many times they have included the letter 'a' in their sequence. So far i have put this together but the output is totally wrong at the moment and it often either just says 1 or 4. Code:
I have built a page on a recruitment website which allows users to upload their CV via ASPUpload i.e a browse button. However I want to limit the file type to just MS Word documents as I do want them uploading large PowerPoint files etc. My idea is to have some javascript which evaluates the last 4 characters of the file name to ensure it is .doc So if they try to upload anything other than a .doc file a dialogue box will appear stating that they must only upload MS Word Document (when they click the ‘Upload CV’ button).
Does anyone know how I can evaluate the last 4 characters of the file name? Once the user has browsed to their CV on their PC the path & file name will appear in a text field called ‘CV’.
I have a HTML form which takes some values including a password field. I have a JS function to check and alert when a user enters some particular special characters(this is bcoz only these characters are not allowed in the back end of the html form, all the other special characters are allowed). following is the code for it.
function checklen() { var iChars = "`<>"; for (var i = 0; i < document.ipform.password.value.length; i++) {
[Code]...
now i want a feature which does'nt allow the user to enter an uppercase letter or a special character(only these are allowed~@#$%^&*()-_+|) as the the first character of the password field. Since i am newbie to JS, It would be a great help if some one can help me to sort out this..
Initially the form is loaded using ASP and HTML and the ü codes display the characters correctly. I have the values stored in a javascript array so that I can more easily and dynamically change the state/region dropdown when the country changes. However, when my javascript code tries to add the new option and print out new region the literal value such as "Würrtemberg" is displayed instead of the special character.
I've been learning javascript for about a week and I'm really struggling right now. This is a homework assignment to help in learning loops and arrays.
What I want to happen is when a form button is hit it will replace the array from the one previous instead of just adding to it. Hopefully that makes sense. What do I need to do? here's my code....
In my application (yes I know that it's asp) I need to automatically replace a character if it is found in the textbox Is there a way to do this. this is how it renders on the page
I'm currently looking at data-piping ie making server calls without reloading the page, the server returning some data to a cookie and the calling page using that same data on the page using DHTML. So far so good...
But is it possible to actually use javascript to actually write more javascript onto the page? Or, alternatively, is it possible to dynamically add a call to an external javascript file.
Something like...
document.writeln('<script src="script.js")
The idea being that the server could return functions for the calling page to use, which would be very nice for complex web applications.
If you can do this, what issues do you need to be aware of?
If you can't, are there any ways of achieveing the same things? I'm thinking of things like dynamically adding a scriptlet call to the page in Windows IE, though a more cross-browser solution would be cool.
I'm using the following function to access elements with specific attribute values in an XML file. These elements then also have child elements, which contain the required data to be rendered as HTML. Code: