javascript

Maven Javascript Compressor

Hello, I want to know how one can compress javascriptfiles using maven. I have lready visited webistes like http://mojo.codehaus.org/javascript-maven-tools/guide-webapp-development.html but there is no implementation expained. I want to know the dependency for executing the maven plugin. Thanks. ...

Joomla page load function

How do you pass items to the jQuery function "ready()" in Joomla? $(document).ready(function(){ // some code... }); I'm already using this function and most items in it will be static (won't change based on modules, etc.). However, in some cases, I need to "inject" additional code into this function. In particular, I have a custo...

Javascript Click handler only if ASP.NET client-side validation succeeds

So basically I want to add a javascript function to a button's Click event and I only want it to execute if the form passes ASP.NET client-side validation. The easiest conceptual way I can think of is to just run the validation within my function just return if it doesn't pass, but I'm not sure how to call ASP.NET's validators from ja...

Changing asp:HiddenField.value with JS on ButtonClick

I have four textboxes in my html; one is a serverside asp:textbox and the others are rendered on the client side using dynamic javascript. The javascript creates the textareas; there may be 6, there may be 90. In this example there are 3. <asp:Textbox id="tbxReal" runat="server"/> <asp:button id="btnReal" runat="server" Value="go" /> ...

how to show and hide a div using onfocus

hi, i'm sorta new to this. i have this so far: <style type="text/css"> #show_hide{display:none;} </style> <div id="show_hide"> ok </div> <input type="text" onfocus="document.getElementById('show_hide').style.display='block';"> it works when i click the input box to show the div. prob is i need it to hide again when i click somewhe...

How to code a general js function for all form submit events ?

I want to code a single js/jquery function for all forms submit events in my application. Currently I am hardcoding on 3 locations like that and it is working but I have to create a function for each form separately: jQuery('#myForm').live('submit',function(event) { // #myForm hardcoded here $.ajax({ url: 'one.php', // one....

How to append a value with button's ID in runtime?

I am using below javaScript code to create table in runtime. And i somewhat assumed to append a value into the ID of the button. Will it work. I am confused because of double quotes. function createTable(){ EmployeeManagement.getList(function(data){ var employee = data; var x = "<table border= 1 >"; x+="<thead> " + "<tr>" + "<td>" ...

How to make javascript work along with Ajax UpdatePanel

I am trying to add validation on my form. I am using AJAX controls in my form fields. When I remove the Update panel and AJAX control, my validation starts working, but when keeping both the things together, my validation is not working. How could I make them work together? <script type="text/javascript"> function Validate() { ...

Javascript String Equality... What's the correct way?

What's the right way to check for equality between Strings in Javascript? ...

why $(window['iframeName'].document.body).html() doesn't work when i change .attr('src')

Why doesn't $(window['iframeName'].document.body).html() ...work when i change .attr('src') When i set the src attribute of iframe to any url when i creating the page, this code $(window['iframeName'].document.body).html() ...will work. But when i change the src attribute by .attr('src',"www.google.com.sa") and wait to load the...

What's the right technique for accessing an object's data in JavaScript?

I have this object: var count = { table: 15, people: 34, places_details: 85, story_1: 21, story_2: 6, story_3: 11, } This array: var categories = ['table', 'people', 'places_details', 'story_1', 'story_2', 'story_3'] And this function: function preloadThumbs() { var j=0; for (j=0; j<categories.length; j++) { var k=1; ...

Google Chrome extension: Mac Compatibility

I've this Tab Sugar Google Chrome extension which works fine under Windows: when installed, the user can click on its icon right in the browser, and access the Tab Sugar dashboard, as a new page in a new tab. But for some reason, it doesn't seem to work at all on Google Chrome under OSX: users experience that nothing happens when clicki...

jQuery ColorBox as POP UP. No Show Images

Hello Community, I am Using Colorbox for a Pop-Up that loads when the page loads. The Pop Up Calls an ASP page with 1 Image, and 1 Button that launches a Chat Window. I got it to work on my local, but when I go remote the images dont appear (all the file paths are correct it looks like). The functionality is there and you can click on ...

Horizontal movement with Javascript

I feel like a complete klutz, I had this working and then I accidentally forgot to save it! I'm an idiot. I've spent the last day trying to recreate what I had but I can't do it. Basically (from my last save) I had this: function canvasMove(e) { if(!e) var e = window.event; var downcheck; var upcheck; var leftcheck; ...

document.activeElement returns body in Chrome and Safari

On a page I have an Iframe that contains input boxes, and if I select one of those boxes in FireFox and use document.activeElement, I get the IFrame. Thats okay, I just use that IFrame and get its contentDocument, save it, then do activeElement again and now I get the input box. However, in Chrome and Safari, when I select one of the bo...

Javascript/jQuery Plugin to plugin to change the border-color, relative to the background-color of an element

In my app i want the users to select a base colour for elements to be displayed on a calendar. From the base colour the user has selected, i need to be able to automatically set an appropriate border colour, and an appropriate text colour. When i mean appropriate i mean a darker tint or shade variation for the border Are there any jqu...

Encryption in Palm WebOS

My question is related to the one here. I know how to send the credentials to a service. What I need is a way to encrypt those credentials. In browser javascript/ajax, when I need to access a service, I put an ajax call in to a php script, which used hash_hmac('md5', $data, $key) as the encryption method. I need to use md5, but Mojo.mode...

Javascript Checkbox.OnChange event not firing properly

So I have a business case where I've got groups (called Bundles) and they can contain other Bundles. Now, in my interface, I'm trying to have it so when you check the top level, it automatically checks (and disables, but I'm not there yet) the child bundles. In order to accomplish that, each checkbox has an onchange event where it pass...

JS: + variable is this right?

$.ajax({ type: "POST", url: "misc/AddFriend.php", data: { mode: 'ajax', friend: c, uID: $('#uID').val(), fID: $('#fID').val(), bID: $('#bID').val() }, success: function (msg) { alert('OK'); $('#friend' + fID).slideUp('slow'); } }); IS this right? It wont s...

Blocking until event

In a web worker, I'm firing off a postMessage() and need to wait for the result before continuing execution. Is there anyway of blocking until the onMessage event occurs, short of busy waiting plus something like Peterson's Algorithm? ...