javascript

Print PDF from javascript

Hello experts, I am using the below mentioned code in my VB.net application to print two copies of pdf document. js.Append("var pp = this.getPrintParams();") js.Append("var iCopies = 2;") js.Append("var iPages = this.numPages;") js.Append("pp.NumCopies = iCopies;") js.Append("pp.interactive = pp.constants.interactionLev...

Can Google Maps plot points based on Hours Minutes Seconds

I'm trying to plot out GPS data that is given to me in Hour Minute Second degree format. Will GLatLng take it in this form or do I need to convert it first. Having a hard time finding anything on the internet about this. If it can take it in this format an example would be much appreciated. ...

Calling Javascript function

Extending a website I didn't build. I want to be able to call the ShowWindow proc with a parameter. How would I do that? New to JQuery and Javascript. default.aspx <script type="text/javascript" src="/scripts/jquery-1.2.6.js"></script> <script type="text/javascript"> $(document).ready(function() { $('a#ShowWindow').click(function(...

How to access child element with javascript?

Im familiar with accessing parent windows like this: window.parent.document.getElementById("ad_nr") But what if I want to access a child window from a parent? (iframe for example) and then set a hidden input in there to some value created in the parent window, how is this done? Probably easy but I have missed it, so Im asking you guy...

Is there a javascript equivalent of php's urldecode or html_entity_decode()?

I've got an associative array in php that I want to stick into a hidden form input so that I can later get the values in javascript. Because of quoting issues, I need to urlencode the json, or htmlentity it. Once I have the object in javascript, though, what's the easiest way to get it back to plain ol' json? OR is there a better way to...

How to get cursor to change before mouse moves when changing the cursor style dynamically

I'm changing my cursor dynamically by setting node.style.cursor = 'foo' when an item becomes selected. It seems that my cursor doesn't change until the mouse moves a pixel. Is there a way to tell the browser to change it immediately? ...

Using JavaScript to get an LDAP multi-valued string attribute

I am trying to retrieve an object attribute in Active Directory that appears to be a multi-valued string (See canonicalName). After performing a search: var conn; conn.Open = 'Provider=ADsDSOObject;'; var command = '<LDAP://CN=Partitions,CN=Configuration,DC=domain,DC=com>;(&(objectcategory=crossRef)(systemFlags=3));name,nETBIOSName,nCN...

Detecting if mouse position is within a set of position rules?

I have some JavaScript objects such as this (it's psuedo so I know if syntax is wrong): [{ "divid":"1","x1":"35","y1":"100","height":"150","width":"150" }, { "divid":"2","x1":"45","y1":"110","height":"150","width":"150" }, { "divid":"3","x1":"55","y1":"120","height":"150","width":"150" }, { "divid":"4","x1":"65","y1":"130","height":"150...

Stripping whitespace from a JavaScript "copy-clipboard" function for Chrome/Safari

I've got a copy-clipboard icon on a website, which, when clicked, invokes the following JavaScript (among other): var hasInnerText = (document.getElementsByTagName("body")[0].innerText != undefined) ? true : false; var elem = document.getElementById(codeID); var content; // strip out all html tags and just get the text if (!hasInnerTe...

Fast Javascript String Replacement

Hey there geniuses of SO! This is for an autocomplete plugin that needs to accept data as an array of arrays and convert it using a format string (or regex). The format string could be any format. var dataArray = [ ["data1-1", "data1-2", "data1-3"], ["data2-1", "data2-2", "data2-3"],... ]; var format = "<li>{0} <br /> -- <small> {1}, {...

Dynamic Property of JavaScript object?

I am wondering if this is possible in JavaScript, I want to have an Object which could contain dynamic properties. Give an example: function MyObject() { } var myobj = new MyObject(); myobj.property1 = "something"; alert(myobj.property1); // something alert(myobj.property2); // this should never report error, instead the property s...

find out what page the iframe is on

Hi. I have a 'toolbar' on the top of my website, and the content of the page is an iframe. How can I find out with javascript what the current URL of the iframe is? ...

.net javascript master pages garbling element name is there a way around it?

Possible Duplicate: Any way to prevent master pages from changing element IDs? Hi I have a .net 2.0 web page that is using a master page. On the page in question is a form and I am trying to call one of the sub element. The form element name is: "contact_label" - its an asp:Label But when I look at the source I am getting ...

Javascript function as callback

The following script produces "Hello", "undefined", "Hello" message boxes: function action(callback) { window.setTimeout(callback, 1000); } var obj = { text: "Hello", f: function() { window.alert(this.text); } }; obj.f(); // Line 1 action(obj.f); // Line 2 action(function() { obj.f(); }); // Line 3 I looking for explanation...

Regular Expression: Split English and Non-English words with Comma?

Is there any regular expression pattern to change this string This is a mix string of üößñ and English. üößñ üößñ are Unicode words. to this? This is a mix string of, üößñ, and English., üößñ üößñ, are Unicode words. Actually, I want to split English words and non-English words with comma. Thanks. ...

Json Date to JavasScript Date Conversion problem

Heres the code for converting the json retured date to a string of date. String.toDate = function(stringDate) { var newDate = new Date(parseInt(stringDate.replace("/Date(", "").replace(")/", ""), 10)); return newDate; } Here are the details: Date from the database: 2009-11-18 03:23:25.107 Date Returned by JSON: "/Date(1258514605107)...

Integrate two javascript scripts and handle user events differently

I am building a search form that use two different javascript scripts. This is the form code: $(function() { $('#txtSearch').chainSelect('#link_id','http://localhost/xxx.com/combobox.php', { before:function (target) //before request hide the target combobox and display the loading message { $("#loading").css("display",...

Are javascript disabled users (which are very low in the world) is a topic of accessibility?

Are javascript disabled users (which are very low in the world) is a topic of accessibility? To make accessible everythig without javascript is more time consuming then to make site compatible for IE6. My question is actually how many people keeps javascript diabled in browser , and if it's very low percentage in the work then why we nee...

Help with changing how jWYSIWYG editor works

In jWYSIWYG editor, pushing enter inserts <br />s. Instead of this, I would prefer that pushing enter would wrap chunks in <p> tags. WHAT IS OUTPUT line <br /> new line WHAT I WANT <p>line</p> <p>new line</p> Quick examination of the config seems I can't do it without hacking it internally. Do you suggest I hack the plugin, or u...

Is jWYSIWYG editor too buggy for production use?

After reading the comments on this site: http://www.webresourcesdepot.com/jwysiwyg-jquery-inline-content-editor-plugin/ There is a bit of consensus that jWYSIWYG editor is too buggy (especially in the last few recent comments). Has anyone had experience with it in a large production site? I haven't run a huge sample of markup through ...