javascript

Mobile Browser Web Page Solution

Hi all, I have a requirement to create a web page that is compatible on all mobile web browsers but I'm completely stuck on the design of the solution. I have been tasked with building a single web page that users complete and then at the bottom of the page, are given the option to save a draft (to return at a later date and complete...

Blocking access to a page in Page_Load method

I have a page that do some validations in Page_Load method According this validation i need to block the access to this page. Example: protected void Page_Load(object sender, EventArgs e){ if (!IsPostBack) { if (MyValidation) { // The page is loaded an de user get access } else { // Here, i need to block th...

How to force clicking on "Refresh" link button after saving some data into DB , by javascript?

Hi I'm completely newbie in JavaScript. Now my problem is: I have a page (Default.aspx). The page has a link button "Refresh" (lbtnRefresh) and another linkbutton (lbtnSave) which saves some data users has entered into DB. I want the page be refreshed after saving data into DB, by using javascript. Is that possible or not? Thank you ...

Custom HTML input component

I am trying to create a new html component using javascript and CSS. The new component is exactly like TextField (<input type="text">). The additional behaviour is each character in the TextField is separated in a box. Is there any existing component available ? If not please give some ideas how to design this component. ...

how to change a css class style through javascript ?

according to the book that I am reading, it is better to change a css, by class when you are using javascript for changing css. but how? can someone give a sample snippet for this ? thanks in advance ...

round number in JavaScript to N decimal places

in JavaScript, the typical way to round a number to N decimal places is something like: function round_number(num, dec) { return Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec); } However this approach will round to a maximum of N decimal places while I want to always round to N decimal places. For example "2.0" would be r...

Calling javascript onmouseout event in javascript

How to call javascript onmouseout event in javascript code? I.e.: var div=document.getElementById('new'); if(div.mouseout) document.getElementById('new').style.visibility='hidden'; Thanks. ...

How to get latitude and longitude of center of google map.

Please tell me how can i raise event just after user change his position in google map using dragging map and get the latitude and longitude of center of google map and the miles its showing from center. i have got lots of pages on google related to it.. but not able to solve this.. please give me solution (i am using asp.net and javascr...

How do you define an OOP class in JavaScript?

Based on my observation, the book that I am reading about JavaScript states that there's an OOP with JavaScript? It doesn't tell much about it, I mean it wasn't explained how to define a class. Can someone give me a sample snippet? Thanks ...

Post and submit problems using javascript, forms and php

Hello, I am trying to create a validate-email javascript and get it working with forms and PHP. Of coures, some problems... As you can see in my form, I did define "post" as the method. But I can only retreive the data as if it was a get method. It was working before I started to add the e-mail verification script and adopt the code t...

How much external data is too much? (XML or JSON)

I have written pure JavaScript front ends before and started noticing performance decrease when working with large stores of data. I have tried using xml and json, but in both cases, it was a lot for the browser to handle. That poses my question, which is how much is too much? ...

Google Toolbar prevents open a new window

Google toolbar is creating a serious problem for me in IE 6 when i try to open a window using window.open or if i set target="_blank" for anchor tag. It treats the window as pop up and dispaly pop up is blocked which i really don't want to dsiplay to my user. This problem only occurs if there is a extra code getting executed before windo...

Get parameters of .js file

Hello, I have a javascript file that I reference in HTML with standard <script src="foo.js?param"></script>. In the file I want to distinguish e.g. loading the file with foo.js from foo.js?auto and foo.js?noauto=true, but not if the file is renamed to bar.js and referenced with the same parameter. How can I accomplish this, preferably n...

How to know how many mils are currently google map is showing

i have got center of map using map.getCenter(); and i got current zoom of google map using getZoom(); please tell me how can i calculate/get current show mils area in google map. i am using asp.net and javascript. ...

jQuery - returning $(this) DOM Element

Hello, i'm using DD_Belated.png to save all IE6 users from seeing the madness of unsupported png. However, this great script takes either selector or DOM Element as parameter to it's only function to do it's magic and return working PNG to IE6. Me, being lazy programmer, did something like this: $("img[src$=png], #search").each ( fu...

Acrobat Javascript Save & Exit Button

I have a writeable pdf form created in acrobat pro. Now, i added a button which has to change a fields value, save the pdf and close it. I decided to do this as following: var fieldX = this.getField("xxxxField"); fieldX.value = 1; app.execMenuItem("Save"); this.closeDoc(true); But this doesn't save the pdf. I don't want to have a ...

How to ignore Onmouseover in javascript on div with absolute position

Hi, I have the following code: <body> <div id="div1" style="position: absolute;"></div> <div id="div2" onmouseover="not handling"></div> </body> div1 covers div2. I need to handle onmouseover on div2. I assume that div1 handles the onmouseover event and postpone it to the body (because the body is a parent element). I cannot chang...

javascript / jquery time count down

Hello I want to make a function either using pure Javascript or also benefiting from jquery to count down to an ending time such as: //consumes a javascript date object function countDown(endtimme){ ... } and it should display in html such as <div id="time_left_box"> <h1>Time remaining</h1>: <p>hours left: ..remaining day wi...

How can I make a program wait for a button press in javascript?

I need to modify some legacy javascript code. There's a place where I want to wait until the user presses one of two buttons and then continue with the program flow (like prompt() function). How can this be achieved ? ...

Why this javascript event isn't working on IE .. ?

I am trying to load options to drop-down list depending on the selection made on other drop-down list. I have written a code which works on almost all major browsers, FF, Opera, Safari but doesn't work in IE7. Here is my Javascript code: <script type = "text/javascript"> var txt1 = "<option>state1<\/option><option>state2<\/option><opti...