javascript escape string
I have the following string: 'You've just created' When I assign this string to a JavaScript variable, this is interpreted as 2 strings because there's a ' character. How can I escape it? ...
I have the following string: 'You've just created' When I assign this string to a JavaScript variable, this is interpreted as 2 strings because there's a ' character. How can I escape it? ...
Certain websites (notably Facebook games) have a step by step tutorial for new users, where JavaScript is used to create a pop-up which tells the user where to click next and what is happening. How does one create such a system? What sort of architecture is required? I suppose that a script is loaded if a flag is a tutorial flag is set...
hi everyone, this sounds like something you could just google, but been looking for hours. basically have this string i am ajaxing from another site 'function onclick(event) { toFacebook("http://www.domain.com.au/deal/url-test?2049361208?226781981"); }' it comes out like that because im extracting the onclick. i just want to extract...
Facebook, twitter have some cool widgets (share, comments etc.) but I can not find similar poll widgets. What simple, customizable and free poll widgets can you advice? ...
Hello, I'm trying to have a javascript alert, after a database interaction and before a page redirect (back to the same page, but displaying the updated data). I thought having a pause before the redirect with usleep() might work, but it seems to ignore it. If I comment out the redirect it takes me to the controller page, where the ale...
I have a select that has several options. No empty option. Before calling the trigger none of the options are selected, after it runs the first option is preselected, and I want that the select to stay as it was, no option selected $("#selProduct").trigger('change'); How to fix this? I still want to trigger the change, to run the eve...
Does anyone know an easy way to use jQuery (or other Javascript if necessary) to extract only the Javascript portion of an anchor tag's href attribute (like the one below), so it can be assigned to another event at runtime? <a id="FancyLink" href="javascript:DoSomething('Input1')">Do</a> I know how to get the anchor's whole attribute ...
var a = window.a || {}; ...
I'm having trouble printing a web page of information, which should span onto about 3 pages. Currently, only 1 page is printed, and the rest of the data is not visible anywhere? Is there some JS or HTML I can use to break the page, and allow the information to continue being printed on the next pages. ...
How do I get a particular GET variable in JavaScript or jQuery? I want to pass it on in ajax script in this sort of way: $.ajax({ url: 'foo/bar.php', data: { search: $(this).val(), page: something //$_GET['page'] only in js }, ... ...
I am trying to break the following sentence in words and wrap them in span. <p class="german_p big">Das ist ein schönes Armband</p> I followed this: http://stackoverflow.com/questions/2444430/how-to-get-a-word-under-cursor-using-javascript $('p').each(function() { var $this = $(this); $this.html($this.text().r...
I have this piece of code: <textarea id="test" style="width: 400px; height: 100px"></textarea> <script> var inserting = document.createElement("div"); document.insertBefore(inserting,document.getElementById("test")); </script> Which should insert DIV id=inserting before textarea id=test, but this error occurs Node was n...
i have this code in my index.html: <div id="users-list"> <tr class="<%= cycle('odd', 'even') %>" onmouseover="this.className='over';" onclick="location.href='<%= user_path(user) %>'" > <td><%= user.surname %></td> <td><%= user.name %></td> </tr> </div> as part of a table, and this associated css: #users-list .odd { backg...
Hi everyone, I would like to Compress all my file .js in a same directory in one file with Google Closure Compiler in a command line. For one file it's : java -jar compiler.jar --js test.js --js_output_file final.js But I didn't find in the doc how put my other file at the end of final.js without write over the last compress file ? I w...
I have an array: myArray = []; To which I am adding objects: data = []; myArray.push( { elem1: ..., elem2: data.push(...); } ); So, elem2 in the object contains an array. How can I, given myArray add new elements to the array in elem2? I tried the following: myArray[idx].elem2.push("new data"); But got an error saying tha...
I'm trying to access JSON data with jQuery and grab a specific set of values based on a variable. I've done this before using [] but for some reason I can't figure out what is going wrong this time. My JSON file (being read in by getJSON, and named jsonmaker.php) looks like this: {"0107001":{"label":"Canada","x":"0","y":"0.34"},"01070...
I'm trying to get mouseover to work polygons in google maps api v3. I've tried the answer provided in this post: http://stackoverflow.com/questions/1751710/google-maps-v3-api-mouseover-with-polygons This answer should be working, but it's not for me. Can anyone spot the stick in my spokes? Here is my code: <!DOCTYPE html> <html> <he...
Hello, I want to save MemoruStream, and I use folowing: ... response.BinaryWrite(myStream.ToArray()); response.End(); User gets saving dialog and he can chose to save file or to cancel saving. But, problem is that can't continue to run code if user chooses to cancel download or, if he chooses to save file. I want to call another meth...
Possible Duplicates: What does this mean? (function (x,y)){}){a,b); in JavaScript What do parentheses surrounding a JavaScript object/function/class declaration mean? Hi All I don't know what the following does: (function(){ // Do something here ... })(someWord) //Why is this here?; My questions are: What's the mea...
How Gmail shows this alert "Exit this page? Your draft has Been modified. Your draft has Been modified. Click OK to continue or Cancel to stay on the current page." when you are writing a email and you try to close the browser tab? ...