Does anyone know the escape character for & and # like in : Update GDO_INFO_ER set V_COMMENTAIRE='B&A' where V_USERMODIFICATION='bilal123' or Update GDO_INFO_ER set V_COMMENTAIRE='B#A' where V_USERMODIFICATION='bilal123' I would like to insert & and # literally in the table.
I have some javscript mixed into a applications templating and have run into a problem the way javascript is handling a path for me.
I am via the template assigning a file path to a javascript variable.
The Tempalte: var myfile = "!FILEPATH!"; which becomes: var myfile = "C:mydir hefile.txt";
The issue of course being that the 's are not escaped. I'm not as fluent in Javascript as I'd like to be yet and I havn't figured out a way to escape it so I can coninue on with the rest of the script. I've tried to do a search and replace but javscript is already interpreting the 's as escaping a character.
How can I either autoescape the 's (if possible), or access the raw data so I can replace with ?
I am having trouble with some code on my site. I have an arcade with game links that have tooltips which display thumbnails. The tooltip code for each link is in the title attribute. I am using javascript to write the code for these links with tooltips so that if javascript is disabled the title attribute displays something different. My problem is some of the tooltip thumbnails contain an apostrophe (') in their src code. I use a backslash () to escape this once but I need to escape it again. Is this possible. The reason I need to escape it twice is one to escape it from the javascript and another to escape it from the src tag (src='Thumbs/image'src.jpg').
I have an announcement webpart on my sharepoint site. The boss wanted attachments to open in a new window so that users don�t close the attachment and get knocked from the site only to have to login again. To achieve this we settled on a policy that attachments should be in the form of PDF documents rather than word format. We contacted Microsoft who in turn developed a solution for us that consisted of a content editor web part that runs some javascript. The problem is 2 fold.
1. The javascript only works in Internet explorer. When used in other browsers the attachments open in the same window.
2. If the name of the document contains an apostrophe, IE barks a javascript error: expected �)�
How do I rewrite the code to escape the apostrophe and to function in multiple browsers?
<script language="javascript" type="text/javascript"> _spBodyOnLoadFunctionNames.push("OpenPDFInNewWindow()"); function OpenPDFInNewWindow() {
I have a string that is encoded simply by replacing the letter with the next letter in the alphabeta. I need a function to convert it back. Following is the function:
function cnvtBack(encoded) { var orig = ""; for (i=0; i < encoded.length; i++) { var letter = ""; letter = encoded.charAt(i); if (letter > 'a' && letter <= 'z') letter = <<previous letter in alphabeta >> // HOW? orig += letter; } }
Please help me to get all characters from every line from a word-wrapped div using javascript.Need to get all the characters for first line, second line, third line,... separately from the word-wrapped div.
Yesterday I discovered a problem on one of my sites: escape function was encoding the same string Sal in two different ways:Sal%F2Sal%C3%B2 This was happening on Firefox 2.0.0.3. In Opera 9.20 was encoded ok every time.
So, in Firefox was a russian roulette . Sometimes was encoding the string like I wanted to, sometimes not. As a solution I use encodeURIComponent(), but the behavior of escape() seems strange to me.
I Have form use javascript to do th basic validation , but some how some one can get out of the javascript validation and submit the form why and how to stop it ?
I wrote the following function to get a font metrics table and it works for all printable characters except spaces. Does anyone know how I could get the width of a space char with known font, size etc...?
I tried several different variations on the "node.style.whiteSpace" line and also tried using an html entity (which gave me the width of the string ' ') but nothing seems to work. All I'm getting for spaces is zero width.
javascript Code:
function JSFontMetrics(inFont, inSize, inWeight, inVariant, inStyle) { var node= document.createElement('span'); var text= document.createTextNode(''); var width = 0;
I'm looking for a function that will convert non-ascii characters to unicode escaped string.For example, "あ" => "u3042".A similar piece of code is below. However, it convert strings to "\uxxxx" instead of "uxxxx". Changing "\" to "" in code below still won't work because that result in 'u' + 'xxxx' which print as "uxxxx".I have been searching for a few days already, and start wondering if this is at all possible. ; (
Code: var unicodeEscape = function(str) { var code, pref = {1: '\x0', 2: '\x', 3: '\u0', 4: '\u'};
i need a plugins or a UI , is some thing like count characters, for example i have a text box and max number of character in text box is 17 and i whan't to show the progres for example 14/17 (14 from 17)
Is there a way to calculate the .offsetLeft or .left of a character in a string relative the element that contains the string? I'm just trying to wrap each character in an element and position the characters independently, so I have to set the .position to absolute, and set the .left and .top on each element as I create it so I can move the elements later on.
I cannot remember the site nor the author, but it works BEAUTIFULLY! I have changed the timeoutInterval to 500 milliseconds as I type with one finger - the original was 250 or even less.
<script language="JavaScript"> // script allows you to type more than one character into a drop-down list // //A typical drop-down need to have ONKEYPRESS and ONKEY functions added // //Example: <SELECT ID='vc_DESCRIPTION' NAME='vc_DESCRIPTION' onkeypress='listbox_onkeypress()' onblur='listbox_onblur()'>
var toFind = ""; // keyboard buffer var timeoutID = ""; // process id for timer - when stopping the timeout var timeoutInterval = 500; // milliseconds - keyboard buffer var timeoutCtr = 0; // initialise of timer countdown var timeoutCtrLimit = 3; // number of times timer is allowed to count down var oControl = ""; // maintains a global reference to the user control
function listbox_onkeypress(){
window.clearInterval(timeoutID) oControl = window.event.srcElement; var keycode = window.event.keyCode;
if(keycode >= 32 ){ var c = String.fromCharCode(keycode); c = c.toUpperCase(); toFind += c ; find(); // search the listbox timeoutID = window.setInterval("idle()", timeoutInterval); // restart the timer } }
function listbox_onblur(){ // function is called when user leaves listbox
window.clearInterval(timeoutID); resetToFind(); }
function idle(){ // function is called if timeout expires - 3rd time stops timer and clear kb buffer
I have a form where users can enter text in one or two textareas. If they only enter text in of of the textareas I can limit the max char to 300 using this:
<script type="text/javascript"> var maxL=300;//nr of max permited characters function limit(obj){ var nr= document.getElementById('nrc') var v = new String(); s = obj.value.split(''); for(i=0;i<maxL;i++){v += s[i]} if(s.length>=maxL){ obj.value=v; nr.firstChild.data = maxL-v.length; } else{nr.firstChild.data = maxL-s.length;} } onload=function(){ document.getElementById('nrc').firstChild.data=maxL; } </script>
Is there a way that I can limit the total char between the two textareas i.e. If a user enters 180 in the first one they can only enter 120 in the second one.
I was wondering if there are any proper, robust libraries or functions/methods that I don't know of that will escape all the problematic characters such as single quotes and tabs.
I find myselfwriting x = x.replace(/'/g,"'"); and the reverse over and over again. Shouldn't Javascript have a built in method to do this? I know of the escape() function but I am not sure if this is more for urls. What is the real world way of storing such an "escaped" variable in a database that will later be read into a javascript variable? :-/
Maybe one could use escape() and unescape() in some way, but some expert probably could answer this in a snap.
I'm passing a parameter to a script, which sometimes fails. However, I discovered that the ones failing had parentheses within the text string, e.g., "Step: Press the (0) on the console."
I've learned how to escape apostrophes, but how do I do so for parens? Is it ( ? Also, where ' was the xml entity for apostrophe, would someone know the one for left and right parens? Can't find that either...not having much luck today with my searches.
I'm using the Jquery UI dialog to popup some alerts and whatnot, and I'd like to be able to analyze the event object passed into my onClose handler, to determine whether the dialog was closed by the User pressing the Escape key (closeOnEscape = true).
Can anyone tell me how to escape the special characters(like &,^,%,$ etc) in a string using Javascript?
For eg. I have a string like this : "Tes$#t" I want this to be changed to Tes$# before sending as a input parameter. So that i can process the string as it is typed exactly.
am in need of escaping the regular expression special characters like '/', '.', '*', '+', '?', '|','(', ')', '[', ']', '{', '}', '\'.I have try with this by the following javascript but i can not achieve that.
RegExp.escape=function(str) { if (!arguments.callee.sRE) {