javascript

ampersand not passing through url

On my site www.gibberize.com if you type in the word "and" in the top textarea, the character "&" will appear in the second textarea. The problem is that the "tweet it" link will then append the second textarea's text to a url and proceed to the link, but because it is an ampersand it will break the text. Any solutions? ...

Anchored AJAX and SEO workaround?

You all know how to build AJAX sites with those 300ms trigger for checking anchors (hash links) in URL and then loading proper page with AJAX. But, these anchor links are nothing to search engines =( I've thought of making some kind of workaround. All JS code remains the same, but, this little thing (I'm with JQuery, sorry): $('a').liv...

String replacement in JavaScript

I have two strings: var str1 = '8***8***'; var str2 = '898-8293'; How can i wrap the digits found in string one, with html elements on the second string, like so: '<b>8</b>98-<b>8</b>293' Note: Not all '8' digits are wrapped. [EDIT] Thanks to Soufiane Hassou and voyager the following worked: <script type="text/javascript"> var s...

I just want to rotate and move the image!! (Javascript, <canvas>, html 5)

http://gist.github.com/232194 I know it's something wrong with my transformations in drawGuy. Can anyone help me figure out how to rotate just the image? Currently it rotates fine, but I something with the transforms is distorting it, so that it doesn't follow the mouse correctly. ...

Add a function to OnLoad in Drupal

Hello, I have a HTML/text default module in the left bar of one of my skins/themes. I have some Javascript in there I'm trying to set today date to my javascript date dropdowns. I am unable to use 'body.onLoad' because Drupal is blocking it somehow? I found a solution saying I can add my javascript function here: if (isJsEnabled()) { ...

What's the purpose of this JavaScript function?

I found this in a file called common.js: function openBrowserWindow(theURL, winName, features) { window.open(theURL, winName, features); } I am trying to figure out what the intention of the person who wrote it was (or whatever program generated it.) It seems like it just mirrors the DOM window.open. What was the purpose? Why woul...

Is a draggable and resizable textbox/textarea possible using jQuery?

I can get the drag to work, but the resizing is not cooperating. (The behavior is evident using either the text box or the text area.) I'm using jQuery 1.3.2 and jQuery UI 1.7.2. Here's my attempt: <HTML> <HEAD> <TITLE>Drag/Resize TextBox Workbench</TITLE> <script src="js/jquery.js" type="text/javascript" ></script> <script sr...

matching password in .net validate by javascript ?

i have two textbox in asp.net and first for password and second is for matching password .. if user give different value in both textbox , then i want to generate javascript at client side.. ...

tabindex on inserted fields

Given that The Browser has a page loaded with an exisitng field (call it ef) with tabindex=1, Two new fields are inserted via bookmarklet (nf1 and nf2) 'first time' (incorrect behavior) When the mouse is clicked on nf1 followed by a tab the focus acts as if the tab was entered from field ef and goes to a place other than nf2. 'seco...

Can User disable javascript at client side ? is it possible ?

it is possible to disable javascript from browser ? ...

Lightweight jQuery tree controller?

I need a simple jQuery folder tree controller with the following features: to be based on a nested unordered list expand/collapse drag and drop to reorder ajax support (not sure if I need this) Which is the tree controller you think is the most appropriate for this? Thank you in advance for your time, titel ...

Compare text with innerHTML IE7 problem

I can't find a work around for the innerHTML bug in IE7. I need to look at the contents of dynamicly generated HTML and change it if the text is "-1". I'm using the prototype js gallery but couldn't find a fix. Any ideas? JS: <script language="javascript" type="text/javascript"> Event.observe(window, 'load', function () { var num ...

displaying news with javascript

I keep coming up against this issue. Displaying news on a website. And I'd like to come up with a solution to use like a template, something I can just drop on a site easily. The solution I keep seeing is an iframe with javascript to scroll the content. However, I'm really opposed to the idea of using iframes, I think the time for those...

You need to select at least one radio button / checkbox

What would be the JavaScript code to check if the user has selected at least one radio button, knowing that the radio buttons all have the same "name" attribute? Same question for checkboxes. I do not use any fancy javascript frameworks such as JQuery and others ... ...

How do I incrementally build and tear down a JavaScript object?

I need a user to be able to perform these actions: Click an "Add" button. This will add a JavaScript object to either an array, or another JavaScript object. Click a dynamic "Remove" button. This will remove the JavaScript object from the array, or object, whose ID matches the button click. Submit the complete array, or object, of des...

JQuery draggable: scroll not working when helper: clone is used

I have a folder list type of situation where I can drag items from one folder to another using jquery draggable/droppable. Folder items are draggable and folders are droppable. These are in a div that is small enough to show a vertical scroll bar. I have "scroll: true" set on the draggable items so that they can cause the div to scroll....

Regex: match and replace on a date

I'd like to convert the date separators in a date. So, from 11.11.2009 -> 11-11-2009 Could someone help me do that with a regex? ...

[JS] Scrolling to the bottom of a div

As part of an ajax chat room (using prototype framework) I am working on I scroll the user to the bottom each time a message is added using the below js. However if the user has scrolled up and the list up dates it jumps to the bottom. Is there any way to detect if the user has scrolled and then disable this function, but also detect w...

Jquery TableSorter 2.0 - Revert Sort order

All, I am using the JQuery TableSorter Plugin. The table sorts fine for the selected columns. Consider that when the page loads, there is no sorting taking place. Now, if the table is sorted by one column, it sorts. Now, upon clicking a "Revert Sort" link outside the table, the tablesorter should revert to the initial sort order, even i...

Is there a current or upcoming standard used by a current email client that lets one use Javascript in an email?

I have a system that emails programmatically generated emails hundreds of times daily. They are going to open in outlook which I know will render the HTML differently than IE and disable scripting. But are there any upcoming standards that will allow one to JavaScript-ify their HTML emails? Will it always be to big of a security risk? I...