In the following link
<a href=\"#\" onclick=javascript:print(\"\") style=\"color:blue;\">Print</a>"
<script>
function print()
{
//How to print the contents of another page
}
I am trying to return two values in javascript
is that possible?
var newCodes = function(){
var dCodes = fg.codecsCodes.rs; // Linked ICDs
var dCodes2 = fg.codecsCodes2.rs; //Linked CPTs
return dCodes, dCodes2;
};
Thanks
With a single page app, where I change the hash and load and change only the content of the page, I'm trying to decide on how to manage the JavaScript that each "page" might need.
I've already got a History module monitoring the location hash which could look like domain.com/#/company/about, and a Page class that will use XHR to get the content…
Camarades,
You'd know me identify good libraries (preferably in jQuery) to work with "Canvas" and drawings in javascript / html. I want to make my page more interesting, especially in some registries (registry of cars) and would like to draw a car and be able to go changing the number of wheels for example.
Many thanks for any help.
Success
I am displaying some simple styled text as html in a UIWebView on iPhone. It is basically a series of paragraphs with the occasional strong or emphasized phrase. At runtime I need to apply styles to ranges of text.
There are a few similar scenarios, one of which is highlighting search results. If the user has searched for "something" I would…
I have a simple array with x number of items. I am displaying them individually via a link click... I want to update a number that say 1 of 10. when the next one is displayed i want it to display 2 of 10 etc...
I have looked all around and my brain is fried right now... I know its simple I just cant get it out.
<!DOCTYPE html PUBLIC…
I dont think this is possible but maybe someone knows a way to achieve this. I want to attach an event to an html element to listen to attribute change. So say for instance that I want something to happen when a visibility of a div changes. The reason is that I have no control over the javascript that is switching the visibility, hence the…
I need your help,
I cannot, for the life of me, figure this out. I've had my head wrapped around it only to no avail. Ideally, i'd like to setup two functions. 1 function: select_date() to interact with the user to select a date from the jQuery Date picker. If the dialog is closed then return as null. Then a second function: test() to…
I'm looking for alternative JavaScript Libraries to learn as an alternative to jQuery, as I think it would be good to know more than one and so i can broaden what libraries I know.
I'd tried Mootools so far but am not sure what else is just as good.
Any ideas?
How do I use the back and forward browser buttons to navigate my javascript/jQuery web application? I know I can do window.location.href = 'this_url#placeholder' and then perform the appropriate action. But when I do that, the browser scrolls to the element with that placeholder id (or to the top if there wasn't one). How do I get…
In complex client side projects, the number of Javascript files can get very large. However, for performance reasons it's good to concatenate these files, and compress the resulting file for sending over the wire. I am having problems in concatenating these as the dependencies are included after they are needed in some cases.
For…
Hello Everyone,
I am encountering a very annoying problem with IE. Basically I need to set the source of an IFrame using JavaScript, however the source document is being executed twice not once during each call.
The simplified HTML code is pasted below (I simplified it so that readers can understand it quickly. The source is…
this is my function (with other lines ive tried/abandoned)...
function DoClicked(eNumber) {
//obj.style = 'bgcolor: maroon';
var eid = 'cat' + eNumber;
//$get(obj).style.backgroundColor = 'maroon';
//var nObj = $get(obj);
var nObj = document.getElementById(eid)
//alert(nObj.getAttribute("style"));
…
I'm loading a stylesheet that is only required when javascript is enabled. More to the point, it mustn't be present if JavaScript is disabled. I'm doing this as soon as possible (in the head) before any javascript libraries are loaded. (I'm loading all scripts as late as possible). The code for loading this stylesheet…
Hi,
I am trying to call javascript method from an Applet using netscapte.java.JSObject.
in the applet:
JSObject window = JSObject.getWindow(this.Class);
Object[] args = .... //arguments
window.call("javascriptMethodName", args);
But I get the exception at window.call:
JavaScript error while calling…
Hello all,
I am developing an ASP.NET web application that incorporates google maps. I have an ASP.NET listbox on my page which contains a list of items. When the user selects one of the items, I'd like to show this item on the map. The main complication lies in the fact that google maps uses javascript to…
hey,
im new to javascript and am intersted in creating a small o3d script:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"…
Hi, I'm using this HTML,CSS and Javascript code (in one document together if you want to test it out):
<style type="text/css">
#slider_container {
width: 200px;
height: 30px;
background-color: red;
display:block;
}
#slider {
width: 20px;
height: 30px;
…
I'm a big fan of Douglas Crockford's writing on JavaScript, particularly his book JavaScript: The Good Parts. It's made me a better JavaScript programmer and a better programmer in general. One of his tips for his jslint tool is this :
++ and --
The ++ (increment) and --…
I have links set up on one page and the relationship between the links is a parent child relationship. (For example: Parent: All, Children: Software; Hardware)
These links of course lead the user to a new page that shows the results from a table that is populated. Currently…
this is my function (with other lines ive tried/abandoned)...
function DoClicked(eNumber) {
//obj.style = 'bgcolor: maroon';
var eid = 'cat' + eNumber;
//$get(obj).style.backgroundColor = 'maroon';
//var nObj = $get(obj);
var nObj =…
I have a form which is essentially an autocomplete input box. I can get this to work perfectly for a single text box. What I need to do is create unique input boxes by using a php for loop. This will use the counter $i to give each input box a unique…
Hello,
Well, I'm completely new to JavaScript.
Can you please tell me what type of data is this JavaScript code:
var options =
{
sourceLanguage: 'en',
destinationLanguage: ['hi', 'bn', 'fa', 'gu', 'kn', 'ml', 'mr', 'ne', 'pa',…
When I run the following piece of code, the engine variable is set to null when I'm using OepnJDK 7 (java-7-openjdk-i386).
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;…
Hi,
I'm trying to insert reCaptcha code into my page from jQuery, but it doesn't work.
Here is my code:
$("#button").click(function() {
$("#loginBox").html($.getRecaptcha());
})
When I try the following, my code doesn't…