javascript

Actual input contents are not preseving on most of the browsers [FF,MSIE7/8 and etc]

Hi, I'm working on one application ( using PHP, javascript ). Below is the short description about my problem statement There are two forms avaliable on my application, i.e. SourceFrm and targetFrm. I am taking input on first form i.e. SourceFrm and doing processing on targetFrm. Below is the input which I am taking from SourceFrm : ...

Ruby object in my JavaScript file

I have a Ruby object and I want to use that object in JavaScript. I haven't seen that type of thing, but I want a Ruby object in my .js file. Is this possible? Thanks in advance ...

Passing Date Object With Ajaxpro

I pass an javascript object from client-side to server-side function with Ajaxpro. In server-side date variables comes inside object are looks like below. What does it mean? How can i parse it to formatted date? "/Date(1280381400000)/" ...

How can I stop the preload of a video (HTML5 - Javascript)

I have a web page with a video player preloading 3 videos (low, med, and high quality of the same video). Then, when the user clicks on one the button corresponding to the desired version, the video opens. What I would like to do is to then stop the preloading of the two other videos. Is that possible? In other words, can the "preload...

Limit Paste in TinyMCE

I have a TinyMCE widget that is limited to only <p> tags and non-block-level elements. Thus, the user is unable to insert tags like <div> or <table>. Which is the desired behavior. However, the user can copy any content from any web page and paste it to TinyMCE. Is there a way to prevent pasting there, or better yet, limit paste to only...

What are some best practices when using jquery for AJAX calls in ASP.NET?

Recently I have been working on project that heavily relies on AJAX calls. In the past most of these calls have been using there own aspx page to post to eg. AJAXgetResults.aspx. After doing some research I saw some examples using jquery's .ajax function and webmethods in the codebehind. I guess my question boils down to. Is there an...

$(this) OR event.target OR var input = $(this)

jQuery is currently providing me with a fun introduction to Javascript after 12 years of surviving happily without. I'm at the stage where I'm trying to learn as much as I can about optimising the code I write and, whilst I have found plenty of good reference material, there is something quite basic which is puzzling me and I have been u...

pass url stored as string in variable to form's onsubmit

how can i make a form tag using onsubmit (that executes upon hitting enter) which opens a target window with a given url in a string variable form? what i have so far: <div id="row2"> <!-- Intranet Search --> <form action="" onSubmit="urlGen(this);" method="get" target="_blank"> <input type="text" id="intranet" size="15" value="Sea...

jQuery/JavaScript - passing variables to functions

Hello there, I have a function that looks like so: window.attack = function(enemyHealth){ attackChance = Math.floor(Math.random()*11); console.log("enemyHealth: "+enemyHealth); //undefined... if (attackChance < 5) { //hit hitDamage = Math.floor(Math.random()*playerDamage+1); enemyHealth =...

Ruby on Rails with Unobtrusive JavaScript - Managing URLs

I'm using a modular system of JavaScript files when working in Rails - basically each view will have its own module in a .js file. My issue comes when I need a dynamic, Rails generated string within my JavaScript, for example translation strings and URLs. Translations are nicely solved using babilu but I'm still stuck on the generation ...

Which Google Maps Option Should I Choose?

I'm currently working on a location-based app and I'm not sure whether I should use the Google Maps API for Javascript or the Google Places Web Service. For argument's sake, assume that both are technically feasible within the context of my app. Given that, what are the pros/cons of each? Is there a reason to use one over the other? Tha...

How to catch id from another page ?

page1 or page2 on same server. page1: <div id="id_div"> </div> page2: getid=id_div I don't care in what programming language, but how to catch id from another page ? ...

JavaScript Event Terminology

What's the difference between an event handler and an event listener? Up until recently I considered them to be different names for the same thing: a function that's called when an event occurs. But I read something recently that referred to the event handler as the DOM element to which the event listener was bound, which would make se...

iframe-like within specific id or class using javascript?

On iframe, it show full page. But I want an iframe-like which showing only within specific id or class. (So, it must be not the usual iframe. I think javascript is the closest solution to this.) ...

ExtJS RowButton that cancel row selection.

I'm trying to add row buttons to a grid panel. Theese buttons should capture the click event, do their stuff, and prevent the row to be selected. The problem is that the row behaviour that changes the row selection is running before the button's event (like if the row was capturing it instead of wait to event bubbling). Is there any wa...

check for extended permissions with new facebook javascript sdk

is there a way to check in my application (canvas) if the user has extended permission (for example "stream.publish")? i only can find a solution for the old sdk. thanks! ...

Load timeout for Javascript

Consider the following document <html> <body> This is some content <script type="text/javascript" src="verySlowToRespond.js"></script> This is some more content </body> </html> I'd like first to check my assumption that it is unsafe for the browser to parse beyond the script tag until the script has loa...

Can't hide my DIV with JavaScript

This is my DIV <div id="MyDiv"> <div class="fa_close"><a href="#" onclick="hFa()"><img src="fadead/close1.jpg" /></a></div> <h1><i>THIS WEEK'S</i></h1> <img src="fadead/special.jpg" alt="special" /> </div> And I am trying to hide it like this but it does not want to work document.getElementById("MyDiv").style.visibility =...

Ajax auto refresh & javascript

I have a page which reloads a DIV with AJAX every 5 seconds. I also have an AJAX sorting script (you can see it here). The sorting script works great when I visit the page for first time, but when the page is refreshed it doesn't work. Am I doing something wrong? I have the sorting script in the HEAD tag, and the refresh on the bottom b...

javascript how to use zindex

Hi , Javascript What is the syntax for zindex i tried like this document.getElementById('iframe_div1').style.zIndex =2000; document.getElementById('iframe_div1').style.z-index =2000; not working even its not showed the error also Also tell for jquery... this is my snippet working fine in html but i want to set this css property i...