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'm trying to make a dynamic form, where I want to add/remove a set of controls (say for Name,Email etc).
Just started but IE behaves differently that FF in the beginning itself. "Add more" works but "Remove this" doesn't. Also the CSS for dynamically created elements doesn't work. Here is my code so far. Code:
i am invoking window.opener.location.reload function from a pop up window to reload the parent page. But this seems to behave randomly. Sometimes the reload would preserve form data eg. the state of the drop down lists. On some other occasions, it would reset all the drop down lists and form data. Does window.location.reload resend form data to the server?
I'm trying to send a byte array (JPG image) from javascript to a servlet for processing. I'm using Base64 to encode the byte array in javascript, and then a base64 decoder in the servlet to decode it.
The thing is, that even though the String has the same length on both sides, the decoded byte array is shorter then the original one. I've tried a couple of different implementation on both sides, with the same results.
Dont know how to put this. In my application i had one jsp where i did some modifications in the java script function and increased the maxlength of a field.
Just these two major modifications i did.But strangely everything got screwed up the function is not being called and many other java scripts func are not being called. Many buttons are not behaving strangely. That jsp is a very big one and a part of a major colossal application so i am not pasting it.
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 javascript calculating the total price of all the products in a shoppping cart. The prices are in the format of 10.99 or 5.50 or 10 ete.g if there are five items bought for 10.99 and 1 bought for 10, the script will multiply 10.99 by 3, then multiply 10 by one, then add the two results.
The resulting number is sometimes right, but quite often it ads an extra '000000002' or so to the amount??
This works and does as intended in all browsers other than (you've guessed it) MS IE wherby a 403 Forbidden error is generated. Anyone got any idea why this is the case and how I can get around it?
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 have a program that creates dinamically a web page. In the page I have the following function to check how many checkbox are checked.
function tarInfo(info) { var i=0; var c=0; var l=document.forms[0].selected_files.length; alert(l); for (i=0; i<document.forms[0].selected_files.length;i++) { if (document.forms[0].selected_files[i].checked) { c++ } } .. ..
The problem is that if I have only one checkbox, the alert(l) write undefined. If I have more than 2 checkbox, the function works well. Here a part of the webpage with one checkbox.
I have been working with with window.promt() and i noticed a weird behaviour.In some cases (i do not known why) my prompt cannot get over a certain limit of characters. But in some other cases it can get as many characters as i want.
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 have set up a disclaimer page for our public access PCs at our Libraries which has the following function:
function breach() { alert("Proceeding beyond these Conditions is..................... If you have read the Conditions, scroll to the bottom and press the 'Yes I
agree' button.") window.location="disclaim.htm"
and then in the body tag I have onunload=breach() This works fine for all websites entered into the address bar except if
you enter www.google.com
What it is supposed to do is bring up the prompt and when you click on the OK button it will go back to the disclaimer page. They should only be able to get to the web by clicking on the 'Yes I agree' button at the bottom of the disclaimer page. Does anyone out there know why google doesn't fire up the disclaim.htm page like all the other sites? It is very frustrating.
We use WebSphere 6.1 as web server and the project is in ear file. After deployment, sometimes access server, the page was load incomplete, such as logo image (.gif) disappeared, and JavaScript error appeared. But after press on Refresh button from browser (IE), the page is loaded completed, all images are loaded and the JavaScript is gone.
[Code]...
We have tried to optimize the JSP page, however the page loaded is faster but this issue still occurred once in a while. Does anyone encounter the same issue before?
This is a support ticket, stating the fact if that IE not support the characte encoding or somehow misinterprets the encoding you will get a strange javascript error called:00ce56e.This will apply on all your ajax transfers for one.For example i had a text/html;charset=utf8 header returned from a php-webservice i wrote. Nice i though, charencoding is the "plant-shit" (Crank quote) and code along and thought to myself, "Damn i'm a witty one". until i started the "IE" beast.. the beast throw out all my claims and the lookout for actually winning this went down. Until i found the above URL.. That is some crackhed shit right there. (Crank anyone?!).What it's stating more or less is that if IE 7 or 8 (or any program that uses whatever that is located in what dll) would more or less shit its pants when it run over an unspported encoding.. In this case UTF-8..
Ok, i'm a swedish guy and uses windows iso latin craptastic charsets more or less everyday but when coding for internationally webpages that are targeting multiple countries you cant get to be staring blindly at your own chars by altering my header to a text/html instead of a text/html;charset=utf8 response to my ajax script i solved alot of strange error shit. (but not my previous post with the fact that IE dont succed even if it would want to, thats a total other question but related but not directly if you get my drift.)..