javascript

onclick event in the javascript

I am very new to javascript I know that you can add an onclick="" event to a html element... but is it possible in the javascript itself to declare that when someone clicks on x element an event is triggered? ...

SharePoint AddDiscussionBoardItem via CAML and JavaScript

I have a SharePoint Message Board named ConceptsGeneralInformation. It currently has two Disccusions in it, they are named GeneralDiscussion and SpecificDiscussion. While a user is viewing a Discussion I want to allow they to post a reply. To do so I am calling the AddDiscussionBoardItem method on WSS via CAML and JavaScript. AddDiscussi...

Ext JS EditorGridPanel not editable

I'm trying to modify this example: http://www.extjs.com/deploy/dev/examples/writer/writer.html to make the all fields in the grid editable (currently only the one field is). I've tried commenting out these lines in UserGrid.js (lines 118-120) as such: //this.stopEditing(); this.store.insert(0, u); //this.startEditing(0, 1); But that ...

Calculate order price by date selection value

Alright, I know there's a simple way to do this, but it's been years since I've done much javascript My client has an online order form for event registration (developed by previous web dev.). Currently the order total is just a hidden field: <INPUT value=78.00 type=hidden name=amount /> But I need the total to calculate based on wha...

Rotate Text with Javascript

Can anyone suggest a way of rotating text by any angle without using something like Flash or Silverlight. I'd like to use a slanted image with the text following the same angle. ...

Redbox Alternative?

I am building an app and want to have a lot of the site forms come up in a box over the screen with the background darkened out. I have seen redbox on github and it seems to do what I need it to do but I see that it hasnt been updated since 2007. Is there a new way to go about this? Any alternatives to redbox? Thanks for your ideas! ...

Why do many sites minify CSS and JavaScript but not HTML?

Possible Duplicate: Why minify assets and not the markup? I have seen a lot of sites using minified CSS and JavaScript to increase website response time but I have never seen any sites use minified HTML. Why would you not want your HTML to be minified? ...

Optimizations to reduce website loading time

What are some important optimizations that can be made to a website to reduce the loading time? ...

How do I insert <span> tags into the middle of text strings that were generated from an XML feed?

I'm building a wordpress theme for a client who wants to pull their favorite songs from Hype Machine into the site. I'm doing by grabbing the XML feed. In terms of styling the results though, I'd like to be able to style the Artist Name differently than the Song Title. Unfortunately, the feed includes both the Artist Name and Song Tit...

Convert Regular Expression pattern from Javascript to PCRE (perl)

Hello. This is my javascript regex pattern: url = "http://www.amazon.com/gp"; hostname = /^((\\w+):\\/\\/\\/?)?((\\w+):?(\\w+)?@)?([^\\/\\?:]+):?(\\d+)?(\\/?[^\\?#;\\|]+)?([;\\|])?([^\\?#]+)?\\??([^#]+)?#?(\\w*)/.exec(url) || []; // would return "www.amazon.com" the above regex extracting the hostname from a given url. I ...

Why won't Cufon allow an addclass function with jQuery?

Man, I just don't get it. I have four sets of paired links, where by hovering over one sets off the other. I have it working in jQuery but when I add Cufon it's no dice. Here's JQ script: <script type="text/javascript"> jQuery(document).ready(function() { var doubleHighlight = function(element1, element2, class) { ...

Using javascript to check if a HTML table cell is empty?

Is these some simple JS code that allows me to check whether a cell is empty. I am trying to code a function that is called using "onmouseover=func()"; I just cant seem to get the JS code right. Any ideas? What im ideally trying to work toward is a code that can detemine whether a cell is empty and if so, place a simple value in, like...

Getting very strange javascript error and this page also refuses to work in Internet Explorer 7 or 8.

This is the page I'm working on... http://schnell.dreamhosters.com/folio/earthquake.html Its purpose is explained via the instructions on the left. I'm finding that after doing so many searches and clicking so many of the links in the list on the right that the page freezes up, the Google Map stops working and Firebug tells me of an err...

How to create "image building" effect

Hello all. I'm looking for a convinient way to create such an effect in a web application: i have some picture, which has not very high resolution, and i want it to appear as a cloud of particles in some random part of the screen, and then to move to it's position. It's ok that i will lose some resolution (i don't think that 1x1px part...

How do I display a gif animation to the user while a picture is loading (in the web)?

The problem: I have set of pictures, when the user presses on one of them, it's grow to an area in the page. The exchange of the pictures is done with the help of js. Tthe picture is weigh about 0.5M, therefore it's take about 3 sec until the picture is showed. I would like to present a type of animation while the picture is not displa...

JavaScript Document.Write Replaces All Body Content When Using AJAX

I am creating a simple ajax call that retrieves the content of a specified url and writes it to the page. The problem I am having is that it replaces the entire body contents with this information here is the JS: (function(){ var mb = window.mb = {}; function get_ad(url, parameters){ var result = ""; var http_...

read php output into a js string?

Basically, I have an html page and I want to create a separate javascript file that reads all of the markup between the tags into a javascript string. Is there a way to do that? EDIT Okay, so, to elaborate a little more... In my tpl.php file, I basically have these lines js snippet: <script type="text/javascript" src="/js/jquer...

Cancel all queued jQuery slideUp and slideDown animations

I have an interface that makes heavy use of the jQuery slideUp and slideDown effect to expand items in a tri-state kind of way. onmouseover: function() { this.find('.details', this).slideDown(); }, onmouseout: function() { this.find('.details', this).slideUp(); } However, when the user quickly moves the mouse over these interface ...

observer does not work in IE

In my ruby on rails app I am trying to use a Prototype Form.Element.Observer to run a count of the characters in a message. This works fine on Firefox/Safari/Chrome, but not on IE. On IE the observer simply does not fire. Is there a fix or a different way of doing this? My ruby tag looks like this: <%= countdown_field('txtmsg[memo]'...

Find and Duplicate image with JQuery

I'm attempting to use JQuery to create a dynamic page header using an image that exists in the article. I plan to give the image a class (.thumbnail). I want to remove the image from the article once it is used for the header. Here is the logic: Find IMG tag with .thumbnail class Move that image to a new DIV (#dynHeader), class it ....