javascript

How to create xhtml elements with javascript

How can I dynamicaly create xhtml elements with javascript? I want to add a checkbox inside a table cell. So I want the code to look like this: <td> <input type="checkbox" /> </td> Unfortunatly the slash at the end of the input element is not added thus making it not xhtml compatible. The result of my code looks like this: <td>...

Vertical Javascript Navigation

Can any one point me to a tutorial for a navigation (in sidebar) in JavaScript? I want it all in one page. Is there any tutorial like that or ready-made script? I have scripts but they are horizontal navigation. ...

Can I use JavaScript to do the same what Adobe Flash does?

Is JavaScript capable of doing the same what Flash does? And if it is the case, can it be a good idea to switch from Adobe Flash to JavaScript? ...

What is the difference between Javascript,Jquery and Ajax programming?

Hey I am new to javascript, Ajax and Jquery.. What are the difference in these programming. It seems Ajax and Jquery are using javascript. so what is the basic difference between these programming languages? ...

Interview Questions for Javascript Problems

Hi, "What is the most difficult problem you faced in web designing (javascript or css related) and how did you debug and solved it?" This is the question asked to me in an interview. According to my experience I answered it but interviewer expected some more advanced answer from me. Could you pls share with me the problems which you fa...

how can i read the vale of first = sign(or the the value of middle = sign) not the last value

i read the answer regarding the answer of this code function delete_subscriber(){ var id=this.href.replace(/.*=/,''); this.id='delete_link_'+id; if(confirm('Are you sure you want to delete this subscriber?')) $.getJSON('delete.php?ajax=true&id='+id, remove_row); return false; } but i want the value read through regular expression of ...

Simulate a mouse click in Flash using JavaScript

Background: I'm developing Greasemonkey scripts for a website. I do not control the Flash file. Question: Is it possible to simulate a mouse click on a button/movie clip in a Flash object embedded in a web page? Googling only shows ways to simulate a mouse click on a DOM element, and ways that require the ActionScript to be changed to ...

PHP: Is this safe for providing JSONP?

<?php header('content-type: application/json'); $json = json_encode($data); echo isset($_GET['callback']) ? "{$_GET['callback']}($json)" : $json; Or should I for example filter the $_GET['callback'] variable so that it only contains a valid JavaScript function name? If so, what are valid JavaScript function names? Or is not ...

iPhone HTML5 App Scrolling Question

I don't know if this is even possible or what to Google to find it, but like you can add: <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/> And it will make it so you can't scroll side to side, only up and down. Is there a way to make it so it doesn't do that overscroll effect...

Submit button doesnt submit form but checks the validations! Coding is in ruby+js

the submit button works only for validating the javascript in the question.js file, but it doesnt do the basic function, which is submiting the form itself! Your help is very appreciated. `Ruby page code containing the form element <script type="text/javascript"> loadScript("/javascripts/questions.js",function() {}); </script> <h1...

Javascript window.open Calling Twice

I'm using this code in a php conditional if/else statement to open a new window. echo("<script type=\"text/javascript\"> <!-- window.open(\"http://www.example.com/index.php?$var\"); //--> </script> "); It's opening 2 windows instead of one, but only on my live site (on a dedicated server) and not on the test site (shared server). EDI...

Submit Button is not working but checks validations.

Hi, The following code works when I submit the form with valid content. But When I submit the form with invalid content, It validates and shows there is an error and reloads the page. But then the form does not gets submitted. Can you please help me with this? Thanks. View Code <h1 class="hdr1">Ask question</h1> <%= link_to Profi...

Display page length at the bottom of table

All, I am using Jquery Data Tables. I am using the following example: DataTables with Pagination I was wondering if there's a way to display "Show 10 Entries" on the bottom instead of top. It should be displayed right before "Showing 1 to 10 of 51 entries".. at the bottom of the table. How can I do that? Thanks ...

Google Maps relative z-order (between different map elements)

I've been having a lot of trouble with a Google Maps mashup because the API only lets you set a z-order for specific item types (e.g. marker, or overlay). For example, you can set a marker's z-order, but that only affects the z-order relative to other markers. I have a map with polygons and markers, but at certain times, I want to make...

document.getElemenyById is returning null

Here's the HTML of my page. Skip the CSS its irrelevant I believe. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; <html> <head> <script type="text/javascript" src="vertical.js"></script> <style type="text/css"> #navlist li { display: inline; /* for IE5 and IE6 */ } #navlist { width: 7em; ...

Odd closure behavior

For some reason, the following bit of code isn't behaving as I would anticipate -- likely due to a misunderstanding on my end as to how it should behave. var contentPane = widget.children("div.content").first(); var success = function (content) { return function (data, successCode, httpRequest) { content.innerHTML = data; ...

jQuery selecting elements by name

Hello, I have the following html: <td valign="top" align="left"> <input style="width:250px;" name="men_url" type="text" /></td> <td valign="top" align="left"> <select name="men_page"> <option value="">Wybierz stronę</option> <option value="index.php?page=8">O firmie</option> <option value="index.php?page=9">Referencje</option> </...

Adding Facebook Connect to a CodeIgniter website

I'm having problems trying to connect my website to Facebook. What I would like it to do is allow users to augment their accounts by connecting them to Facebook (I do not need people to be able to login with Facebook, I am using OpenID instead). My website runs in the CodeIgniter framework. What I will do is remove everything that I've ...

[jsTree] Move all the children of a node to another node

Hello. Suppose I have a tree with nodes and sub-nodes. I want to move all the children of a node to another node ("under" the destination node, among the already existing children). Also, it would be nice if this didn't generate a move_node event. Can anyone help? Thank you in advance. ...

javascript new self invoking function

Hey, I've got a question about self invoking functions in javascript. What I'm doing is something similar to the following myNamespace = {}; //namespace for holding any objects/functions //helpModule as an example myNamespace.HelpModule = new (function(){ this.abc = '123'; //lots of other code in here... })(); now I'm abl...