javascript

'Enter key' wont submit form in Firefox, but will in Chrome, why?

I have a form, very basic, and when I hit enter key nothing happens in firefox, but in google chrome it submits. Haven't tried other browsers yet... Nothing happens at all when hitting enter in firefox. When clicking the submit button it works fine in both browsers. The form is inside a DIV, and the form has javascript too, here is th...

Equal Height not working in Safari (jQuery)

$.fn.equalHeight = function () { var height = 0, reset = $.browser.msie ? "1%" : "auto"; return this.css("height", reset).each(function () { height = Math.max(height, this.offsetHeight); }).css("height", height).each(function () { var h = this.offsetHeight; if (h > height) { $(this)...

jquery validate: adding a required rule with custom message based on wether a different form field has a value.

Hello Everyone, I know this seems like a repeat question, but i've read all the others and they arn't quite the same :( I've got some drop downs, and if they have something other then an option with a value of "0" selected then I want the coresponding Expiry Date field to be required. I tried putting the rule in the class of the...

Can PHP be inserted into a javascript call in my header?

I have a wordpress theme that I like to duplicate. To make things easier on myself I'm trying to use the bloginfo function to call my jquery file..like this: <script type="text/javascript" src="<?php echo bloginfo("template_url"); ?>/js/jquery-1.4.2.min.js"></script> I just can't get it to work. When I check my source file it looks ...

how to include content from an external site?

This is a great big mess... I know I could use an iframe, but the problem there is that there are some cross-site limitations that wind up botching what I'm trying to do. Namely, the source content is a fixed height div that allows scrolling, but without the scrollbar. If I load that up in an iframe, it won't have the same effect. I...

Google map in jsp document

Hi, I am trying to implement google map api into one of my web page which is generated by jsp document, and I am having trouble getting it work. I found some jsp taglibrary by www.lamatek.com/GoogleMaps, but it doesn't seem to work.(I mean even examples on their web site don't work) Has anyone done work on google map in jsp document...

Visual Studio 2010: Publish minified javascript files instead of the original ones

I have a Scripts folder, that includes all the .js files used in the project. Using the Ajax Minifier task, I generate .min.js files for each one. Depending on whether the application is running in debug or release mode, I include the original .js file, or the minified one. The Scripts folder looks like this: Scripts/script1.js Scripts...

How to create a table with the same dimensions as a previous one

I would want to create a table with the same widths (table and its cells) then a previous one created dynamically 1st __________________ |_____|___|_______| |_____|___|_______| |_____|___|_______| 2nd __________________ |_____|___|_______| |_____|___|_______| What do I need to do to set the second one with the desired widths. (Tab...

Minimize response/request packets

Hi, I want to shrink the data that is sent back and forth via AJAX, so that it sends/receives less data. I will de/compress server-side (C#) and client-side (Javascript), before/after every response/request. What would be the simplest way to do this? All communications is done via JSON strings (both request and response). ...

on open window browser

is it possible to default a window size to 1280 width on websites not full screen? If we can default it to that size would it be a problem for people who only has their resolution set on 1024? ...

jQuery Animate Effect not doing what its supposed to...

The JS: var dialog = jQuery('#dialog'); dialog.animate({ 'top':'-4px', 'display':'toggle' }, 300); The CSS: #dialog { display: none; position: relative; width: 180px; height: auto; margin-left: -20px; top: -15px; } The Problem: The animate executes and the div appears into view but after the animate is done executi...

How to find out emails and names out of a string in javascript

I am using a cool widget to import email addresses out of gmail/homail/yahoo etc. The widget is still beta and I guess thats why it does not allow a lot of configuration. It actually just fills a textarea with the following data: "Name one" <[email protected]>, "Name Two" <[email protected]>, "And so on" <[email protected]> So I wondered if so...

Chrome Developer Tools, using inspection functions inside script tags.

I've looked around on google and I cannot figure out to use for instance the dir() function within the web page I'm working on, I would like to have it spit out debug statements, as I'm used to doing with Firebug. A clearer example What I want is to do the following. <script> a=document.getElementById('gabber'); dir(a); </script> ...

looking for a tag script for my website

Hi, I'm not asking someone to make a script for me, only to point me to a known script. A lot of websites have tags on the end of a article with important keyword links, mosly those are scripts used in CMS systems. I'm looking for the same sort of script but for a "normal" website without cms Does anyone knows a script like that? ...

Deselecting a single row in jqGrid

Is this possible without hacking into the innards of the jqGrid JS? setSelection( "rowX", false ) doesn't work, and resetSelection() deselects all rows. ...

Fast method to find regex matches in a large document using javascript?

I need to search the text in a HTML document for reg-exes(emails, phone numbers, etc) and words. The matches need to be highlighted and be made anchor-able so that a link can be generated to jump to the location of the matches. So not only does it need to find matches using patterns in needs to do a replace do add the proper html code. ...

Loading javascript in an iFrame on different subdomains

I have a javascript function that loads CKEditor in one of my iFrames. Problem is that my iFrame is located on a different subdomain. I fixed this by using document.domain, however my CKeditor only loads sometimes. Does anyone know how to solve this? ...

What does /[\[]/ do in JavaScript?

I am having trouble googling this. In some code I see name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); /[\[]/ looks to be 1 parameter. What do the symbols do? It looks like it's replacing [] with \[\] but what specifically does /[\[]/ do? ...

How can I reorder a select list on the fly?

In my application, I have an HTML select box from which I remove and add items based on various user actions (the items become available/unavailable). However, I would also like all items to be displayed in preferred order, so every time I return an item to the select list, I need to re-sort in preferred order and select the preferred op...

Enlarging two objects at the same time in one animation action ising jQuery

Please look at the following test page : sample page showing two images. You see small images which get a bit enlarged when you move over the image. I have used jQuery to do this, but ran into the following problem. The only way I got the wanted effect was to enlarge the white <div> and making the image a percentage of the encapsulati...