javascript

CKEditor 'h is null' error when re-opening lightbox

I'm using CKEditor for a Content Management System. When someone edits the text on a page, a lightbox opens with CKEditor. When I close the lightbox, my code destroys the CKEditor instance. When you open it again, I get a Javascript error that says 'h is null' on line 13 of ckeditor.js Here's my code: $('#editSidebarModuleLightbox').ht...

Set <a> to display none

Here is my HTML: <td> <a class="link" href="#"> <span class="download">Link</span> </a> <a class="link" href="#"> <span class="csvdownload">Link 2</span> </a> </td> I need to set this CSS: a.link { display: none; } But only to the <a> that contains the span with the class csvdownload Ideally need to do this strict...

jQuery.replaceWith() on input field and regaining focus in IE

There is a script http://gist.github.com/457324 that sets default text (taken from element's title attribute) for empty input[type=text] and input[type=password] elements. For password elements it is not that trivial though. If I did $(this).attr('value', $(this).attr('title')); for input[type=password] it would just show dots instead...

Is there some library to help me to write Javascript code in C#?

I'm looking for something to help me to write C# code that would be automatically converted to javascript. The advantage would be code-completion and type-safety. Some features that I'm looking for are the following: Auto creation of prototype equivalents to C# classes. Auto generation of javascript code based on C# code (property set...

If IE then include file [A] else include file [B]

Hello, I have page for which I want to load different content for different browsers. Example : IF Internet explorer {include file="/content1.tpl"} ELSE if any other browser {include file="/content2.tpl"} {/if} Content1.tpl & Content 2.tpl are two different files having their respected Html & CSS. How can I achieve this usi...

How to either determine SVG text box width, or force line breaks after 'x' characters?

Hi, I'm creating an SVG text box using the Raphael library, and filling it with a dynamic string which is extracted from an XML document. Sometimes, this string is longer than the canvas I am placing the text box on, so I need to either limit the width of the box which will itself force the line breaks (I can't find any evidence of thi...

How is this superb site constructed?

I found a website last night that is simply awesome. Here's the URL: http://yourworldoftext.com/ WARNING: Site may be NSFW. And it got me thinking straight away how this site is constructed. Taking a look at the page source doesn't reveal much, but if I look at it in Firebug I see a lot of tables like this: <div class="tilecont" styl...

Javascript in wicket ModalWindow

Hi everyone! I have next situation: I open ModalWindow and show in it several Panels by clicking on button - and I need to attach some JavaScript on viewing concrete Panel. How can I do it? I tried to add Behavior on my Panel: add(new AbstractBehavior() { private static final long serialVersionUID = 1L; @Overri...

How can I parse this particular JSON data from LastFM using jQuery?

I'm attempting to parse a JSON feed using the LastFM API but there are certain elements returned in the JSON array that are prefixed with a # that I don't know how to reference. The feed URL is here and it can be seen visualised here. My jQuery code so far looks like this: $.getJSON('http://ws.audioscrobbler.com/2.0/?method=geo.geteve...

How to write high quality Javascript

I have been in the process of learning Javascript to complement ASP.NET. I have a strong background in general programming, and have always been an advocate of disciplined practices and good hygiene to reduce the error count in code. However, the language that Javascript is seems to make this very difficult. Its dynamic and interpreted ...

Is it possible to style military bases only with the new Google Maps v3 styled map?

Already asked on Google groups, not getting any responses... I was playing with the Google Maps v3 style wizard and noticed that if you set a style for poi only, it will set the style for military bases. Unfortunately, it also sets styles for all other points of interest. Anyone know if there is a way to style military bases only? poi....

Unit test a firefox extension?

I'm working on a Firefox extension and started building automated tests using jsUnit. I run into permission errors running the tests from the TestRunner as soon as my extension code refers to any XPCom components. Is there a better tool for me to use for this, or how I can get around the permissions issues and continue to use jsUnit? ...

Binding event to text node

Here's my HTML. I need to bind a click event to "someText" <div id="container"> someText <a href="#">A link</a> </div> "someText" could be any string of text ...

SWFObject 2.2 static publishing method and click-to-activate mechanisms in legacy IE

As you know in legacy (and unpatched) Internet Explorer, you have to click on active content (like Flash) to start it. I know Microsoft added the click-to-activate "feature" then removed it a couple of years after but I'm still stuck with customers with this "feature" still there. I would like to use SWFObject 2.2 (latest) to embed Flas...

ASP.NET/JavaScript - I'm trying to get an ImageButton onClick event to swap images.

i have a navigation bar made up of ImageButtons that have their image swapped out on mouse over and back on mouse out. i used this code in the Page_Load handler to do this: ImageButton1.Attributes.Add("OnMouseOver", "this.src='mouseover.gif'") ImageButton1.Attributes.Add("OnMouseOut", "this.src='mouseout.gif'") what i'm trying to do n...

Advanced selector - Hide Parent

Here is my HTML: <td> <a class="button" href="#"> <input id="download">...</input> </a> <a class="button" href="#"> <input id="downloadcsv">...</input> </a> </td> Using CSS I want to hide the <a> which contains an input with the ID = downloadcsv Is there a parent option in CSS? Edit: As current aswers indicate you cant hide ...

Detect if Javascript is enabled?

Hi, Is it possible to detect whether javascript has been disabled if so redirect to another page? My application is being developed with JSPs, as I am using a lot of fancy javascript stuff in my application. Thanks in Advance Dean ...

CSS Change in multiple locations on hover (jquery solution needed)

Hello, I'm working in wordpress, trying to figure out how to change the css color of a side nav element when a remote image is hovered. I would have done this easily with CSS and just assign the CSS hover class for each item, but since this is a CMS, the navigation and the image gallery will change dynamically. So, I'm looking for a J...

Architecture for Java, Android, Database Application? whoat shold the app look like

I have a site where, via Android, a user needs to: fill in a document (simple html I think). the next step would be to sign on the Android. the data should be saved into a database inside the site. Points I should mention: the UI should be as simple as it gets I am the one who should build the web database So therefore my idea wa...

How to Request Permissions in the new Facebook JavaScript SDK?

I'm trying to switch over to the new Facebok JavaScript SDK from the old JavaScript library (where I was using Connect) and I'm unable to get the permission dialog to appear. I'm trying to get the permission dialog that's shown under the "Data Permissions" section here. My old call was this (with appropriate initialization): FB.Connec...