javascript

How viruses get through browser to pc as JavaScript do not have much privileges ?

I would like to know how browser allow viruses to pass through to our computers. Response we receive is a text response.. Only executable thing in the response is JavaScript which does not have much privileges, what makes browser favor certain files to be passed to computer? ...

How do I refer to an <iframe>'s document using jQuery to get its height()?

I'm trying to get the height of an <iframe>d document. My first instincts were: $('iframe').document.height(); or $('iframe').contentWindow.document.height(); Those don't work, and I'm not having much luck searching. I would appreciate any help! ...

Turn off auto centering with JQuery scrollable.

With the JQuery scrollable widget. If you click the top, it scrolls to the middle. Is there any way to leave the "clicked" elements within the widget where they are when clicked? [Position1] [Position2] [Position3] [Position4] [Position5] For example, if I click Position5, I want it to stay in its place, NOT scroll itself into Posit...

The Facebook footer bar is an iframe, so why it doesn't it reload with the rest of the page?

I want to know how Facebook is doing their iframe footer bar. I mean, i know they have an iframe on footer, but i want to know how they are reloading pages without reloading the iframe also, 'cause the iframe always stick there even though the page does reload again. Any ideas/knowledge? EDITED: Try clicking on a link which is differen...

Prevent WebBrowser control from stealing focus?

Is there a way to stop the WebBrowser control from causing its parent form to bring itself to the front? If you use the InvokeScript method to invoke a JavaScript function that calls focus() on an iframe within the main parent document, it will cause the window to bring itself directly to the front(or atleast cause the taskbar icon to s...

how to eliminate space in forms in php

how can i prevent a form to be submitted when it only contains a space? for example a user presses the space bar on a field, the space will be considered as a character so the forms submits. how can i prevent that in php? ...

jQuery: prevent form submition with enter key.

I just wrote this nifty little function which works on the form itself... $("#form").keypress(function(e){ if (e.which == 13) { var tagName = e.target.tagName.toLowerCase(); if (tagName !== "textarea") { return false; } } } In my logic I want to accept enters during input of a textarea. Also wou...

how to check special permissions in facebook

hey how can i check in javascript if user has granted my site the publish stream permission ? ...

Recalculate image map after window resize

I have an interesting problem: My girfriend (painter...) wants to have a web page like this: first page is just an image, through all screen - with no slider etc. So here is the problem of resizing images for different resolutions. On this image are some windows, where user can navigate throught the rest of the page. SOLUTIONS: So...

Checking JS variable value in another <script> block

I have a site built with simple templates; header.tpl, navigation.tpl, body_home.tpl, body_about.tpl, body_anotherpage.tpl, etc. The navigation.tpl contains jQuery and is used to dynamically build a drop down navigation menu. When an element is clicked on the first drop down menu, the next is built based on what element was clicked. At s...

How do I find out the DOM node at cursor in a browser's editable content window using Javascript?

I am looking for a solution that works cross browser i.e. IE, Firefox and Safari. ...

Google Maps not functioning for me

Hey all, My Google maps code is all squared away and valid, but it doesn't load on the page. Here is the page in question, I have full availability to code, not sure why it's breaking: http://whs.rjuhsd.us/calendar/map The Gmaps JS is in the header, with the correct key. Sensor is set to true, and the element is defined in the documen...

Writing a JavaScript abstraction abstraction - is this sane?

I've written a JavaScript application that runs off Prototype & Scriptaculous. I'm thinking of rolling it out in as an open source product & would like it to be able to run on jQuery as well — I typically use jQuery for most of my other apps, except the site this app was originally built for. I was originally thinking about building two...

Programmatically call anchor tag to Page Top at load time

Hi, I have a anchor tag that when you click on the "Up to the Top", it will move the web page to the top of the page. My anchor tag is #PAGETOP. My question is, I am using the jQuery UI Dialog and basically would like to programmatically activate this #PAGETOP anchor so whenever the page always loads at startup, would like to ensure th...

Why is FBJS dropping my 'onclick' attribute from this input element?

When I include an 'onClick' attribute in setInnerXTHML() like this: var innerHtml = '<span>Build Track: Select a city where track building should begin'+ '<div id="action-end">'+ '<form>'+ '<input type="button" value="End Track Building" id="next-phase" onClick="moveTrainAuto();" />'+ ...

Set position of page footer using CSS/JS

I've created a standard header, body, footer web page. I want to position the footer to be at the bottom of the viewable browser window when the body is smaller than the height of the window, but at the bottom of the page when the body exceeds the browser height. Any suggestions on how I use CSS (preferably) or JS to accomplish this? ...

How to show loading image when a big image is being loaded?

Hi all, How to show loading image when a big image is being loaded? As an example in Orkut when viewing a photo in user photo album there is a loading image shown over the photo until the Photo is completely loaded. I need to implement that feature. My question is how implement that feature? Is it possible without using JQuery? Plea...

Include jQuery document.ready() as an include file

Hi, Am I able to include as an include, an external jquery.dialog.js file that consists of the following: $(document).ready(function(){ $(function() { location.hash = 'PAGETOP'; }); $("#dialogou").dialog({ autoOpen: false, closeOnEscape: false, resizable: false, modal:...

Inserting Record into database using Javascript!

Hi Is it possible to insert data in a database using javascript only. if yes then please post a simple example of it. Since javascript is a client side language and not a server side,i think its not possible. But then how to do it. ...

Javascript Method Naming lowercase vs uppercase

I am for the most part a developer in ASP.NET and C#. I name my variables starting in lowercase and my methods starting in uppercase. but most javascript examples I study have functions starting in lowercase. Why is this and does it matter? function someMethod() { alert('foo'); } vs function SomeMethod() { alert('bar'); } ...