javascript

Learning JavaScript in one weekend?

Similar to this question, I am wondering if experienced JavaScript developers have any websites they use with examples to get the basics of JavaScript down in 24/28 hours? I have looked at Douglas Crockford's Google Tech Talk and I bought the book "Javascript: The Good Parts", but I haven't had time to read it. ...

Will the Order of my Associative Array be maintained from PHP to Javascript?

In PHP I'm running a mysql_query that has an ORDER BY clause. I'm then iterating through the results to build an associative array, with the row_id as the key. Then, I'm calling json_encode on that array and outputting the result. This page is loaded with AJAX, and defined in a Javascript variable. When I iterate through that Javascr...

ASP.NET MVC - Javascript array always passed to controller as null

I'm having some problem with passing a javascript array to the controller. I have several checkboxes on my View, when a checkbox is checked, its ID will be saved to an array and then I need to use that array in the controller. Here are the code: VIEW: <script type="text/javascript"> var selectedSearchUsers = new Array(); ...

Simple application to aggregate information from multiple web services in fullscreen

Whats the easiest way to build a simple 'web' application which is a single page, that just refreshes itself (using AJAX or something) to display continuously changing data hosted on various different servers on the internet? I want to interface with (for example) Twitter, Facebook, Skype, Google Calendar, and any number of other servic...

Submit form using javascript, work in FF but not in IE

I have this code. The code below is working in Firefox, but it is not in IE <?php // file: login_dfr.php ?> <body> <?php $data = getLoginData($_SESSION['whoyouare']); ?> <form name="frm_redirect_dfr" action="<?php echo $data['url']; ?>" method="POST" id="frm_redirect_dfr" style="display: none;"> <input name="DFRNet_User" value...

jQuery: tabs where the tab/content can be linked to

My issue is simple. I have already implemented a tab system, and I'd probably spend more time implementing another one with the solution I need, than giving a shot at adapting the code I have, and learn something while asking :) My problem is that the tabs can't be linked to, I need to be able to link to a tab from another website or p...

Can I test for the end of the content of a text/plain file with Selenium or javascript?

I have a page that results in a text/plain file being displayed in the browser that looks like this: ... Admin Site Administration 2010-04-21 22:26:34 [email protected] Test Site Bob Smith 2010-04-21 22:27:09 [email protected] Admin Site Administration 2010-04-21 22:29:26 [email protected] I am trying to write a...

Is there a way to use javascript to remove all changes that javascript has made to an element's css? In other words, is there a way to asychronously redisplay an element with its original css formatting?

For example, <html> <body> <img id="pic" src="original.jpg"/> </body> </html> In Javascript (jQuery): $("#pic").attr("src","newpic.jpg"); Now, is there a way to reset #pic's src to original.jpg without explicitly setting it as $("#pic").attr("src","original.jpg");? ...

How to Add/remove row in table in jquery when we check and uncheck the checkbox in other table?

hi i have one table where i have select the row by checking check box. I wanted to add selected checkbox rows to another table which is dynamically created when some one check checkbox. I am waiting for you response ...

XSL Doctype Issue

I'm having issues with an XSL template that is outputting to HTML. There is a javascript being rendered on the resulting HTML page that requires a strict doctype in order to work across all browsers. However, I cant get the doctype to show up. Any thoughts on this? Would it be possible to insert it dynamically, using javascript or ph...

Usage of values stored in $_GET / $_SESSION in Javascript

Hi, i'm pretty new to Javascript and PHP so please bear with me if i'm asking some really dumbed down questions. Ok, say i need to use values stored in a PHP $_GET or $_SESSION, is it advisable to just do something like var something = PHP echo $_SESSION or $_GET ...

How to hide Div tag without page refresh

Hello.I have a page where i add,edit and delete menus.For add and edit I have a separate page.When i add or edit menus,i come on the main page where i display the menus,so i print messages as "menu added" or "menu edited".But when i delete the menu,my page does not get refreshed,because i have written the delete code on the same page sin...

top rounded corners in my jquery

Hello everybody, I have this jquery for my menu buttons, what I want is to get top-corner rounded for my menu, this is a whole code: <html> <style type="text/css"> #menuBarHolder { width: 860px; height:45px; background-color:#000; color:#fff; font-family:Arial; font-size:14px; margin-top:20px;} #menuBarHolder ul{ list-style-type:non...

String.fromCharCode & CharacterSets

Hi Folks, I recently tried to mirror some input within input(text) fields. Using String.fromCharCode(event.which) for instance, translates all 'standard' characters correctly. Well it translates them all to uppercase, but that you can easily catch by looking up the shift key aswell. My Problem is, it can't translate characters like...

delete the entire table rendered from different pages using javascript

HI , i am having a table like <table id="toc" class="toc" border="1" summary="Contents"> </table> in many pages .. All these pages are rendered in a single page . when i apply the javascript to delete that using on load . Only one table is deleted and not the others i am trying to delete the tables in all the rendering pages usi...

HTML text-area editor for code that traps TAB key

Hello, I have looked for months now, for JavaScript-based HTML editor I can embed onto my web pages to replace a TEXTAREA, but to enable me to edit CODE in a friendly, closer to a real editor, way. All editors I've tried (RadEditor from Telerik, FCKEditor, TinyMCE, etc etc), do not trap the TAB key, very useful when editing HTML code ont...

How to remove an element from opener window viewsource using javascript

Hi Step 1 I've two screens one is parent and the other one is child. On click of a button in the parent window the child popup will open. Step 2 On click of a button in child i'm displaying the html(viewsource) of parent window in a textbox(.net) and holding in a hidden variable hdnSource too. Step 3 I've 4 checkboxes in the child ...

detecting object-reference duplication across JavaScript files

I have a number of files with contents like this: function hello() { ... element1.text = foo.locale.lorem; element2.text = foo.locale.ipsum; ... elementn.text = foo.locale.whatever; ... } function world() { ... var label = bar.options.baz.blah; var toggle = bar.options.baz.use_toggle; ... } Thi...

MooTools - Programmatically fired events not working with event delegation

Would really appreciate if anyone can help me figure out why I am unable to fire events programmatically when using event delegation in MooTools (from the Element.Delegation class). There is a parent <div> that has a change listener on some child <input> elements. When the change event is triggered by user actions, the handler on the pa...

JS variable scope missunderstanding

I have a little problem: slideHelpers.total = 4 for (i=1;i <= slideHelpers.total; i++) { $('<a href="#">' + i + '</a>').bind('click', function(){ alert('go to the ' + i + ' slide')}).appendTo('.slideaccess') } the alert gives out 5 what is logic, because when the function click triggers i is actually 5. But i would like to have th...