javascript

Writing to an iframe from NSTextView

Hey All, I have built a web based WYSIWYG editor, which Im accessing programatically from my cocoa application. At the moment I'm able to run scripts and retrieve the HTML from the iFrame in the editor, but I'm unable to send text from an NSTextView to the iFrame. Any ideas? The editor is here http://www.alexmillsdesign.com/Developer/F...

What JavaScript events are available to WebKit on Android?

I'm building a mobile web app targeting Android users. I need to know what JavaScript events are available to me. I have been able to make the following work, but not terribly reliably: click mouseover mousedown mouseup change I have not been able to get the following to work: keypress keydown keyup Does anyone know the full list...

Changing the browser preference from javascript

Dear All I'm having a problem with cookies, if the browser has cookies disabled, the cookie gets rejected. Is there a way enable cookies on the clients browser, that is compatible with IE, Firefox ,Opera and Chrome? ...

how to reload the parent page from popup window without deleting control values

i have created two aspx pages, parent and popup page.I want to refresh parent page after some operation in popup is completed.I am using the Page.RegisterStartupscript Option for the reloading the parent page but if i call some server event from parent page that also repeat twice..i dont need that...i tried out each soln what i can do .....

How can I convert string to datetime with format specification in JavaScript?

How can I convert a string to a date time object in javascript by specifying a format string? I am looking for something like: var dateTime = convertToDateTime("23.11.2009 12:34:56", "dd.MM.yyyy HH:mm:ss"); ...

Javascript syntax of "a= object,object"

Yesterday I found this function: function clone(obj) { return typeof obj === 'undefined' ? this : (clone.prototype = Object(obj), new clone); } I though that i saw alot in Javascript, but this syntax is unknown for me: clone.prototype = Object(obj), new clone Can someone explain me how to read this?? Can you give me li...

Very Advanced Javascript WYSIWYG editor

I need a solution where a user could enter the URL of a web page in my system. The page would load, and then the user could click a certain section that he wants to change. So basically what I need is, a way to display a web page inside my app (could possibly be done with frames but I'd prefer not to have a horizontal scroll bar), and th...

Using Javascript in CSS

Is it possible to use Javascript inside CSS? if it is. Can give a simple example? ...

null coalescing operator for javascript?

Is there a null coalescing operator in Javascript? For example, in C#, I can do this: String someString = null; var whatIWant = someString ?? "Cookies!"; The best approximation I can figure out for Javascript is using the conditional operator: var someString = null; var whatIWant = someString ? someString : 'Cookies!'; Which is so...

Preloading images with jQuery

I'm looking for a quick and easy way to preload images with JavaScript. I'm using jQuery if that's important. I saw this here (http://nettuts.com...): function complexLoad(config, fileNames) { for (var x = 0; x < fileNames.length; x++) { $("<img>").attr({ id: fileNames[x], src: config.imgDir + fileNames[x] + config.im...

How to read inline styling of an element?

Howdy all. I'd like to know if it's possible to determine what inline styling has been attributed to an HTML element. I do not need to retrieve the value, but rather just detect if it's been set inline or not. For instance, if the HTML were: <div id="foo" style="width: 100px; height: 100px; background: green;"></div> How can I dete...

Can you access sceen display’s DPI settings in a Javascript function?

Is there a way to access the screen display's DPI settings in a Javascript function? I am trying to position a html panel on the page and when the user's DPI is set to large (120), it throws the position off. I need to be able to know what the DPI is so I can adjust the position accordingly. Thanks everyone, Jeff ...

Is a DOM Text Node guaranteed to not be interpreted as HTML?

Does anyone know whether a DOM Node of type Text is guaranteed not be interpreted as HTML by the browser? More details follow. Background I'm building a simple web comment system for a friend, and I've been thinking about XSS attacks. I don't think filtering or escaping HTML tags is a very elegant solution--it's too easy to come up w...

jQuery time picker

I know there are a few plugins out there but I was wondering if anybody here had a preference for any particular one. I'm looking to fill a text input with a time that the user can choose in 15 minute intervals. ...

Problem accessing remote CSV using dojo

Hi, I am trying to create a website where I host my data on google spreadsheets, and show data to the user in his browser using dojo. However, I am getting the error Access to restricted URI denied" code: "1012 when the browser encounters: var stateStore = new dojox.data.CsvStore( {url: "http://spreadsheets.google.com/pub?key=p0jvMl...

dojo.xd.js not recognizing dojox.data.CsvStore

Hi, When I use an import such as <script type="text/javascript" src="http://o.aolcdn.com/dojo/1.2.3/dojo/dojo.xd.js" djConfig="parseOnLoad:true, isDebug: true"></script> I get the error dojox.data.CsvStore is not a constructor for lines such as var stateStore = new dojox.data.CsvStore({url: "dojo-passcsv.php", label: "name"...

Calling a jQuery function with JavaScript

Dear all I am using JQuery and javascript, I need to Call the JQuery function inside my Javascript. My jQuery: function display(id){ $.ajax({ type:'POST', url: 'ajax.php', data:'id='+id , success: function(data){ $("#response").html(data);...

Browserless JavaScript

I talked to the Team Lead at Snap-On Tools once, and she told they used an "implementation of JavaScript" for their server-side coding. It's been a while, but I was thinking, WTF is she talking about? Are there interpreters for JavaScript besides those implemented in browsers? How can you create a program or code, especially server-sid...

How do i assign value to a textbox using javascript

hi everyone, I have an asp.net mvc application and i am trying to assign value to my textboxe dynamically, but it seems to be not working ( i am only testing on IE right now ) . this is what i have right now.. document.getElementsByName('Tue').Value = tue; (by the way tue is a variable) I have also tried this variation but it didnt wo...

How to check null objects in jQuery

I am using jQuery, I want to check existence of an element in my page. I have done following code, but its not working? if ($("#btext" + i) != null){ //alert($("#btext" + i).text()); $("#btext" + i).text("Branch " + i); } Please tell me what will be the right code? Thanks ...