javascript

Problems with javascript scope in firefox

Hello! <div id="myElement1"></div> <div id="myElement2"></div> <script> window.onload = function() { document.getElementById("myElement1").onclick = function() { for (i = 0; i < 2; i++) { document.getElementById("myElement2").onmouseover = func; function func() {alert("hello"); } } } } </script> In...

get value from XML File in JavaScript

I have an XML File with the following format: <containers> <container> <item> item name </item> <item> item name </item> <item> item name </item> </container> <container> <item> item name </item> </container> <...

Pop up message like SO Flag window

How do i create a pop up window/message like what you see on this site when you click the flag link ...

Setting a variable name with another variable value - Java Script

I want to get a value from a variable then use that as the name for another variable. I got something like this: var eval(BodyWeight[i]["ExerciseTitle"]) = BodyWeight[i]["ExerciseVideo"]; This is giving me an error, 'missing ; before statement'. Any ideas? ...

XmlHTTPRequest: "XML Parsing Error: no element found"

So I'm using PHP+MySQL to deliver database contents in XML to a JavaScript. $xml = "<?xml version='1.0' encoding='utf-8'?><confessions><pending>"; $pending = $m->MySqlHandler->Query("SELECT id, gender, age, confession, date_posted FROM confessions WHERE publish = 0"); foreach ($pending->Rows as $pr) { list($id, $gender, $age, $confe...

jquery , how do i select attr href target hide

$('a.minimize').click(function() { $($(this).attr('href')).hide(); }); <div class="drag" id="2"> <a href="#content" class="minimize" style="display: none;">2</a></p> <div id="content">1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<...

How to execute JavaScript writen in one page from another page?

How do I execute JavaScript written in one aspx page from another aspx page? ...

handle javascript injection in asp.net mvc

How can we handle the javascript injection in asp.net mvc (C#) application? I can use Html.Encode in my View. But the problem is i have html also to show in the page like a blog post. I need to remove the script entered in the input elements of the application? How can i do that in a common place? ...

how to get javascript values into asp.net gridview

Hi i have two javascript values and i want to store that values in the gridview so hows this is possible ...

Reading contents of a text file using JavaScript throwing error

I'm using the following code to read the content of a text file using javascript. But when I'm getting an alert message which says "An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?" When I click on yes nothing is happening. I'm using IE 6.0 function ieReadF...

Passing javascript code in JSON

I am making an AJAX call with jQuery to a PHP script that needs to return javascript code embedded in a JSON result for the jQuery code to execute. How do I go about passing javascript code in JSON? ...

How to update a div with an image in Django?

The following is a matplotlib code that generates a scatter plot in as the response. def plot(request): r = mlab.csv2rec('data.csv') fig = Figure(figsize=(6,6)) canvas = FigureCanvas(fig) ax = fig.add_subplot(111) ax.grid(True,linestyle='-',color='gray') ax.scatter(r.x,r.y); response=django.h...

Safari and Chrome doesn't evaluate dynamically added <script> tag at page load

I am writing small JavaScript code which will load external js files at html page loading. I tested 2 ways. Case 1: Used document.write to add <script> tag. It worked for all browsers (IE, FF, Safari, Chrome, Opera). Case 2: Used DOMElement.appendChild to add <script> tag to the <haed> element. Only worked for IE, FF, and Opera. Did ...

How can I prevent selecting text in Google Chrome?

Doesn't oEvent.preventDefault(); work in GC? I need to prevent selecting text when the onmove event is triggered. EDIT: It turns out to be very easy... function disableSelection() { document.onselectstart = function() {return false;} // ie document.onmousedown = function() {return false;} // others } function enableSelection() {...

how to store javasript value in mysql database in asp.net

Hi i have a text value of javascript and i want to store that values in the datbase of mysql so ...

Javascript check Mouse clicked inside the Circle or Polygon

Any one know how to check that wheter a mouse is clicked inside the circle or polygon. My problem is I want to check that if mouse has been clciked inside the circle or polygon. circle or polygon coordinates has been stored inside an array. Any help is really appreciated ...

My Mehod on btnclick is not working, here i have given the code

Cant call method of Button if Button is added to panel in the .net so wt can i do? my code Add Category ...

How do I run a system command in a cydget using objective c or javascript?

Hi! I am trying to run a Ruby script from a cydget (cydget is a framework made by Saurik for writing lockscreens on the iPhone, using cycript, which is a mix of javascript & objc - see http://www.cycript.org/ ) The script will first check to see if a WEBrick server is running, if so it will quietly exit, if not it will start the server...

can any one help me in getting php class to min js and css codes

I'm looking for a php class that can minify js and css code. thanks ...

JavaScript equivalent of this simple php...

Hi, please can somebody let me know how to do the following PHP in JavaScript. The vaibles in PHP are Parameters in Javascript. If all three Parameters are set then I would like a PHP script to execute: <?php if isset($nation,$service,$slider) { //execute php script } ?> Thanks for looking, and maybe helping! To c...