I am trying to pass a message between my popup to a background page using the one message interface (I’m using code similar to the one in Google’s example for this). popup: and this is how I listen (and reply) in background.js: Now when I inspect everything in the console the messages are exchange…
Tag: javascript
Print out Javascript array in table
I have this array: and I would like to print the entire array out as a html table. How would I accomplish this? I tried this but could only get the final name the print: Answer Using jQuery you can do: jsFiddle: http://jsfiddle.net/davidbuzatto/aDX7E/
How to click an element in Selenium WebDriver using JavaScript?
I have the following HTML: My following code for clicking “Google Search” button is working well using Java in WebDriver. I want to use JavaScript with WebDriver to click the button. How can I do it? Answer Executing a click via JavaScript has some behaviors of which you should be aware. If for ex…
Put javascript and css inline in a single minified html file to improve performance?
A typical website consists of one index.html file and a bunch of javascript and css files. To improve the performance of the website, one can: Minify the javascript and css files, to reduce the file sizes. Concatenate the javascript files into one file and similar for the css files, to reduce the number of re…
How to create a login page for a user that checks their password on the client side
How do I create a login page that checks for a correct password on the client side and goes to the next screen if the password is correct? Here is my attempt: Answer
Javascript string-replace function ignoring hyphen
I have the following code: The alert gives hello,,..there I would expect it to give hello—,,..there as all the characters, including hyphens, are specified as exceptions in the replacement function. What am I doing wrong? Answer Escape the hyphen:
Javascript disabling Div element on submit
The code below just hides the movie that I am playing behind. Remove element (if possible) or disable it, specially movie playing in background. I tried using document.video.disabled=true; but its not working. Any idea how to go around this problem please? Answer Try
Alternative to Javascript prompt box for younger users [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 7 months ago. Improve this que…
Populate countries and cities dropdownlist with javascript in asp.net
I have a register form in a fancybox as an inline content and can access to it in all the site as the link is in the master page. On the register form I have two dropdownlists one for country and the other for city. When the user changes the country the dropdownlist of cities refresh as the country selected
How to call php file into a div?
I’m trying to reload only specific div Because div content is much larger, I tried: How can I call the code from a .php file into a div ? Answer use $(‘div’).load(‘phpfile.php’) $.load is used to load data from the server via an html file or a server-side script like php. Just to…