javascript

greasemonkey insert javascript

I have a bookmarklet, clicking the bookmarklet includes a PHP script (evaluated as a JavaScript file) to the page few table values and select values passed as GET parameters. The PHP script writes the page data to the MySQL database, and outputs a success message that is treated as JavaScript code and executed by the browser. Is there an...

jQuery::Scrollable Div does not work

I am trying to create a scrollable DIV using the following: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html> <head> <title>Test</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <script type="text/javascript" src...

javascript get child by id

<div onclick="test(this)"> Test <div id="child">child</div> </div> I want to change the style of the child div when the parent div is clicked. How do I reference it? I would like to be able to reference it by ID as the the html in the parent div could change and the child won't be the first child etc. function test(el){ el...

How do I get the clicked element with inline HTML onclick and jQuery?

Hi, I'm creating a tags with this code: $('#td' + id).append('<p><a href="#" onclick="excluirArquivo(\'' + response + '\'); return false;"><img src="/erp/proposta/media/images/delete.png" alt="Excluir arquivo" /></a> ' + file + '</p>'); excluirArquivo function function excluirArquivo(arquivo) { $.ajax({ type: 'POST', ...

How to play flv stream in HTML page not specialy creating SWF app?

How to play flv stream in HTML page not specialy creating SWF app? So I heard there is some way just using some html code to create SWF inside HTML page just for FLV playback... Is it possible, how to do it? ...

what is this.parentElement?

pg.myfunc = function(){ var i = 1, j = 2; this.selected = 1; xx.newObject = this.parentElement; ..... .... what is xx.newObject = this.parentElement; doing? thanks ...

Regular expression for browser Url

I am new to JavaScript i need a regular expression which allows both of this forms for example : http://www.google.com www.google.com ...

Loading city/state from SQL Server to Google Maps?

I'm trying to make a small application that takes a city & state and geocodes that address to a lat/long location. Right now I am utilizing Google Map's API, ColdFusion, and SQL Server. Basically the city and state fields are in a database table and I want to take those locations and get marker put on a Google Map showing where they are....

Ajax post failing in asp

hey guys, this might be really stupid, but hopefully someone can help. I'm trying to post to an external script using ajax so i can mail the data, but for some reason my data is not making it to the script. $(document).ready(function() { $("#submitContactForm").click(function () { $('#loading').append('<img src="http://www.xxxxxxxx....

Remove body element

How to remove HTML <body> element with all of its content? var e = document.getElementsByTag('html'); e.removeChild('body'); Does not work. ...

mouseover producing multiple images works in Firefox, but not i.e.

The code below allows the user to hover over 1 object and it not only replaces the object but also shows an additional object between the buttons. It works great in Firefox, but does not in Internet Explorer. HELP webpage: http://www.isp.ucar.edu/ Thx, Terri if ( < document.images) { img1on = new Image(); img1on.src = "im...

JavaScript function pass-through?

I'm not sure if this is doable, but I would like to be able to set a jQuery UI event as a function (directly), as opposed to continuing to wrap in additional function(event, ui) { ... } wrappers. Hopefully you can see what I'm going for from the example below. Here is what I would like: $("#auto").autocomplete({ source: "somepage....

jquery drag and drop animation

I have some UI functionality for drag and drop, but when an element is dropped, the animation makes it flit about all over the place for a split second before it appears in the newly dropped location. Can anyone advise how to tackle this, so that the draggable element moves more cleanly into place on success? Here is a snippet from t...

Javascript disabled help

Hi All, I have a simple .html page which uses Javascript to display some popups. Now If the Javascript is disabled I want to show some text with anchor links so if javascript is enabled I should be able to show the popups but if Javascript is disabled i want to display some text and popups shouldnt be displayed. I dont want to use is t...

Javascript ||, how to compare multiple variables value?

How to right this syntax correctly: if (tipoTropaPrioritaria[m] || troopsCount[m] || availableTroops[m]) == ("null" || "undefined") { ... } (to check if any of the first 3 variables is null or undefined) ...

Geo Location with javascript .....

I am trying to geolocate a user then present him a driving path to my location using django and javascript. The js i am using is over here: http://github.com/gvkalra/random/blob/master/templates/home/index.html If to the geolocation prompt I say "Share my location", the system is not working. I am unable to figure out why ..... Please h...

ASP.NET: How to assign ID to a field in DetailsView?

I have a master-detail page, in which I use GridView to display multiple rows of data, and DetailsView + jQuery dialog to display the details of a single records. only one DetailsView is open at a time. I need to be able to pull out a single field of the open DetailsView, for manipulation using JavaScript. Is there a way to give a uniqu...

nextSibling issue, should be simple

Ok, I'm trying to come to grips with this nextSibling function in JS. Here's my issue within the following code... var fromRow = document.getElementById("row_1"); while(fromRow.nodeType == 1 && fromRow.nextSibling != null) { var fRowId = fromRow.id; if (!fRowId) continue; // THIS ONLY gets done once and alerts "row_1" ONL...

Facebook Open Graph - 'Like Button' - Hidden Content Revealed Upon 'Like'

I was wondering, I wish to have a landing page with Facebook's Open Graph (specifically the like button) and I wanted to basically have content set to display:none (can't remember the specific until a user likes a page. An example being a div on an e-commerce store that when a user likes the page, the div is set to display:block and us...

How to structure javascript callback so that function scope is maintained properly

I'm using XMLHttpRequest, and I want to access a local variable in the success callback function. Here is the code: function getFileContents(filePath, callbackFn) { var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState == 4) { callbackFn(xhr.responseText); } }...