Hi,
I have the following code. And my problem is that when clicking, the event is firing but the argument passed is not the correct one. It is passing the last dynamically created row i.e. dataStructure.length value. Anyone knows a solution how to get around this?
var table = document.getElementById('output'); ...
Hi,
I would like to create universal templating engine in JavaScript, how to?
HTML template
<h1><%title1%></h1>
<h2><%title2%></h2>
JSON file
{
"title1" : "Hello World!",
"title2" : "Hi World!"
}
Javascript
Find in HTML file <%title1%>
Find in JSON file variable "title1"
Replace <%title1%> with value of variable "title1"
...
Just like you visit maps.google.com.tw or maps.google.co.kr or maps.google.co.jp, you can see their own language shown on every country. Is there any property that I can use in Google Maps API to dynamically set google maps using specific language to display?
...
Hi!
I have a following Kohana setup:
All my files are placed under 'public_html/koh'
My js files are placed under 'public_html/koh/media/js/'
I use html::script helper to include those javascript files which generates me following html code:
<script type="text/javascript" src="/koh/media/js/site.js"></script>
In my js I access one ...
$(".delete").click(
function() {
var thesender = this;
$(thesender).text("Del...");
$.getJSON("ajax.php", {},
function(data) {
if (data["result"])
$(thesender).remove(); // variable defined outside
else
alert('Error!');
...
I have a <div> element with position: absolute and z-index something big. I would like to cover the entire screen with this div with javascript.
This is what I do and it works:
document.getElementById('mydiv').style.top = 0;
document.getElementById('mydiv').style.left = 0;
document.getElementById('mydiv').style.width = '100%';
document...
Hi all
I have a div that I would like to reposition each time the page is refreshed.
It is currently set in the css using top and left. I wold like to pass the top and left values on page refresh.
#inneriframe
{
position:absolute;
top:-170px;
left:-5px;
width:1280px;
height:1200px;
}
The content is from another site and contained in...
Hello,
When the user sets the focus to an edit control on my HTML page, I want some other text to appear "around" it, to give some hints for how to fill out the edit control, and some buttons to fill it with random data. What's the best way to do this with javascript or jquery or whatever?
Thanks.
...
I want to write a program that can turn on Caps lock key without having the user to press the physical key on his keyboard.
Is there a way to do so in Flash, Javascript - if not, any other languages ?
...
The following jQuery example should put some text into the div, but it doesn't. I tried Firefox, Google Chrome and Internet Explorer.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" language="javascript"></script>
<script language="javascript">
$(window).load(function() {
$('adiv').html('...
I have about 5 Quicktime movies that I hide with jQuery when the site first loads. I noticed when I put the site online that when I open the site it takes 5-10 seconds to show any content. Sometimes I even get a "beach ball" cursor as if the browser is frozen.
It's not like all the videos need to be preloaded before the site can load, ...
Hey all,
I tried my best to convert javascript to fbjs according to this page: http://wiki.developers.facebook.com/index.php/FBJS.
Yet my tabs are still not working properly. Does anyone have any suggestions how to fix this so I can click through the tabs and display and hide content accordingly:
<script type="text/javascript"><!--
va...
Currently, when I design my forms, I like to keep the name of the submit button equal to the id of the form. Then, in my php, I just do if(isset($_POST['submitName'])) in order to check if a form has been submitted and which form has been submitted.
Firstly, are there any security problems or design flaws with this method?
One problem ...
Hi,
When someone click on Browse for the input file below:
<input type="file" name="blah" />
A dialog box will appear. The user will then select a file and click 'Ok'. The dialog box will close. Is there an event fire because of that? I tried onfocus and onblur, it didnt work out.
The only way I can think of is to start a timer to ...
Hi guys,
For example I have a PHP array, such as this one
<?php $s= array('a','b','c','d','e','f') ; ?>
And I need to loop through it in JavaScript, any ideas how do I do that?
for ( i=0 ; i < <?php echo sizeof($s) ?> ; i++) {
document.write('<?php echo $s [somehow need to get the 'i' value into here] ?>');
}
Any suggestions? Thank...
Hi, I'm developing using the new ASP.NET 4 and I ran into the following issue. When I put a Menu control into the web form, the menu causes the following code to generate just before the closing tag:
<script type='text/javascript'>new Sys.WebForms.Menu({ element: 'NavigationMenu', disappearAfter: 500, orientation: 'horizontal', tabInde...
How to show an image while we select the option below.
Example : -
<select name="payment">
<option value="">Please Select</option>
<option value="Paypal">Paypal</option>
<option value="Bank">Bank</option>
</select>
<div id="payment"><img src="paypal.gif" alt="paypal" /></div>
If we select paypal on div id="payment" will show the log...
JavaScript's late binding is great. But how do I early bind when I want to?
I am using jQuery to add links with event handlers in a loop to a div. The variable 'aTag ' changes in the loop. When I click the links later, all links alert the same message, which is the last value of 'aTag'. How do I bind a different alert message to all lin...
I need to be able to represent high and lows using a javascript charting libraries. All the libraries I have seen only allow defining the "high" value and the low value is always defaulted to zero.
Thanks!
...
I have to pass paramter the validateNum javascript function (eg. num1, num2)
if (num1.attachEvent) {
num1.attachEvent("onkeypress", validateNum);
}
How to pass. can i get code sample?
...