javascript

Multiple lines of text to clipboard

Is there a way to send multiple lines of text to the clipboard using javascript? IE, I want to send: abc def ghi and not abcdefghi (and although right now i need to learn how to do it in Javascript, I would not mind hearing how it is done in other languages, like python) ...

Prevent Users from submitting form by hitting enter #2

Well in a previous question I asked the same thing, but the answer that i doesn't prevent a submit when the user is in a text-box. So basically what i need is the ability to keep a person from submitting a form unless the explicitly click the submit button. edit: basically the main reason for doing this is that this is an employer sur...

Receiving complex javascript values through external interface

I'm trying to receive and potentially send complex values through TWebBrowser (using TEmbeddedWB) with the provided external object. For example; in javascript I would try to use the exposed method with an array as a parameter: var test = [123, 'abc']; external.someFunction(test); //Or something more complex var complexObject = { som...

Javascript variable not displaying properly.

I'm trying to create a Vista gadget, I've properly stored my Date1 variable and am trying to pull it: <html> <head> <title>None</title> <link href="style.css" rel="stylesheet" type="text/css"> <script type="text/javascript"> System.Gadget.settingsUI="settings.html"; System.Gadget.onSettingsClosed = settingsClosed; function settingsClo...

How to pass HTTP AUTH values via prototype Ajax.Request()?

Is there any way to pass HTTP AUTH username and password along with an Ajax.request()? Basically, I'm trying to find the equivalent of: curl user:pass http://url.com Is seems this has to be available, but I can't figure it out. If not, is there another JS alternative? ...

How to reduce XMLHttpRequest time lag?

I use a XMLHttpRequest on a signup form to see if the username they entered has been taken already. The script runs fine, but I notice that there's some time delay when making the request - the webpage is frozen for a second, after sending the request. Is there a way to have the request "in the background" and not cause any lag on the f...

How do I get the user number from inside a stackoverflow page using javascript?

I'm trying to set up a page that (if it were part of stack overflow) would generates a Stackoverflow Flair Blogger Gadget. ...

How can i get eval to function properly in IE?

I have the following: <select id="price_select"></select> I have an event handler that invokes the following: var selected_option = "one"; var option_one = "<option>Option Contents</option>"; document.getElementById('price_select').innerHTML = eval('option_' + selected_option); Works just fine in Firefox but not in IE6. ...

What is a good way to get feedback from a user on a website?

I'm working on a website for my county's fair. I want to allow my visitors to be able to ask me questions by inputing their name, email, and comment in a form like this one: So I guess my real question is how can I send an email (using JavaScript/JQuery) to myself with all these fields as the main body of the email. ...

(Simple) Are HTML script elements allowed to be external even when in the body?

In HTML, are the <script> elements allowed to be external and use <script src="myscript.js"> even when in the <body> of the document? ...

How to display excel chart in browser?

I have an excel sheet containing excel chart. I am able to display entier excel sheet on browser using an iframe. However, I only want to display the chart present inside the excel sheet on the browser. How do I achieve this? I see that it needs Javascript + ActiveX APIs. I tried but couldn't get it to work. Please see code given belo...

Using Jquery calling different functions with a singe link

*I would like to use single a href link to call different functions . On first click it should call first_function() and on second click it should call second_function. Like toggling between two functions using same link. Suggest the best way to be done.* Jquery Code : $(function() { var IntervalId; function first_function() { ...

Why HourGlass not working with synchronous AJAX request in Google Chrome?

I am executing a function where first I am making cursor to wait state(hourglass) and then I am sending a synchrounous AJAX request .After getting the response I am making cursor to default state. The Actual Code is this.. // tests the smtp settings function TestSettings() { var buttonparams= new Object(); buttonparams.IsCommandBu...

Using jquery to toggle between different function and not getting resumed where it left

The code of the first function shows three different divs on specific Interval 5seconds (div1,div2,div3). The code of the second function used to stop showing the divs. while showing div2 , I clicked the link to stop at that point it got stopped.But after that i clicked it again and it shows div1 (its getting toggling fine) but i would...

Howto get iframe linking to internal document source using javascript/jQuery?

Hi there, I have an iframe with id "appframe", the source is page.html and it's on the same server. I want to get the source of the page using jQuery. alert($("#appframe").contents().find("html").html()); returns <head></head><body></body> even though the document does not contain those tags, it only contains "Default page", so that ...

"Please wait" image on every user action with ASP.NET 3.5

Hello, In our ASP.NET 3.5 application, we would like to implement a "Please wait.." feature : on every user action (button click, tab change, etc.) we would display a little spinner on top of the page (actually in a separate frame that we use already have). We thought of this solution : "hijack" the _doPostBack to intercept every e...

Passing arrays using json?

Hello I have this php code $ids = array(1,2,3); $names = array("cat","elephant","cow"); $originalSettings = array ('ids'=>$ids,'names'=>$names); $jsonSettings = json_encode($originalSettings); echo $jsonSettings; and this is the jQuery code $.post("ajax.php", {}, function(data){ data.ids.each(function(i) { alert(dat...

Different Javascript behaviour in different browsers

I'm doing a eCommerce website, but dealing Javascript is killing me. For example, for the following page, http://nordschleife.metaforix.net/118/118/index.php/sony.html It works as intended in Google Chrome, but not in IE or Firefox. For instance, clicking the up or down arrow for products that are down the page (e.g., tenth product) wi...

Detect iFrame embedding in Javascript

I have an application that has a certain page -- let's call it Page A. Page A is sometimes a top-level page, but also sometimes is embedded as an iframe within page B. All pages come from the same server and there are no cross-domain issues. I have a greasemonkey script that runs on page A. How can the greasemonkey script detect whether...

can a page always refused to be iframed or be part of a frameset if javascript is enabled?

When a page is iframed or included as part of a frameset, it can use Javascript to check so. (i think usually by if (self != top) top.location.href = self.location.href; ). Can the page always "jump back out" like that when Javascript is enabled? Is there a way to not let it jump back out? (suppose my page is iframing that page). ...