javascript

JS: Math.random for array

Learning JS this week. Is it possible to use Math.random to return a random value in an array? Does that value be a string and still work? ...

Executing Javascript in iFrame from Parent

Hello, Just a heads up I am a semi noob at JavaScript. So for the past two days I have been googleing and for the life of me I cannot figure out how to execute a function in an iframe from the parent page. The page in the iframe is on a different domain and the code to be executed is usually executed via a link, but I want it to be exec...

Sending Data To Server

I have a programm where i get the values of two variables for example x and y using javascript functions.How can i send them to the django server so as to do something(for example search in the database for matching values).How can i do this "SENDING" thing.Which language should i use for example? ...

problem executing php file with javascript

Hi all, i have been learning about javascript and using dojo. I am trying to execute a php file with dojo. My code is dojo.xhrGet({ url: 'helloworld.php', load: testCallback, error: testError, content: {name: dojo.byId('name').value} }); for the dojo function. The php file is basically a simple script that prints the val...

How to remove border from iframe in IE using javsascript

I am trying to insert an iframe into the browser DOM via javascript and want to remove the border if IE but can't seem to. I have tried these to no avail: iframeElement.style.borderStyle="none"; and iframeElement.style.frameBorder = "0"; Any suggestions will be much appreciated. ...

HTML and CSS in URLs causing 404 errors (User Agent = Trident/4.0)

I've been getting some 404s with snippets of code (CSS, HTML and JavaScript) in the URL. As best as I can tell the user is progressing through the site just fine during their session - its an ecommerce site and the effected users are putting stuff in their basket and checking out OK etc. On certain pages I'm see 404 errors adjacent to ...

jQuery UI Tabs loading specific link within tab

I want to load only links within a certain div inside the tab, otherwise it should just go to the actual link. Current the code i use loads all links inside the content in the same tab <script type="text/javascript"> $(function(){ $('#tabs').tabs({ load: function(event, ui) { $('a', ui.panel).click(f...

How to detect TraceMonkey?

Is it possible to detect that a Firefox browser is running the TraceMonkey JavaScript interpreter? If so, is it possible to do it with JavaScript? A solution which involves examining the browser binary or shared libraries is also OK for me. I'm running Linux with Firefox 3.0.14 right now. ...

JavaScript Stop Button for wmv

I'm trying to get a button to stop an embedded wmv when I click it. I've been searching for awhile now and I have tried a number of different methods, but nothing seems to be working. he closest I've come was from using the example on this page: http://www.killersites.com/mvnforum/mvnforum/viewthread?thread=3883 However it only seems t...

Help with Mootools locating the conflict in my ugly code

Hi, I need help in locating the conflict in my code, below is my ugly code (I'm just starting to write my mootools and my approach i think are ugly). the site can be seen here http://tinyurl.com/y9xvm6b. I think it is conflicting with these lines <script type="text/javascript" src="/lotsforsaleroxascity/media/system/js/mootools.js"><...

Markdown And Escaping Javascript Line Breaks

I am writing a markdown compiler in Erlang for server-side use. Because it will need to work with clients I have decided to adopt the client side library (showdown.js) as the specification and then test my code for compatibility with that. In the first couple of iterations I built up 260-odd unit tests which checked that my programme pr...

jQuery binding function on focus

I'm writing a little plugin for jQuery and so far I've got this: (function($){ $.fn.extend({ someFunction: function() { return this.each(function() { var obj = $(this); obj.focus(someInternalFunction(obj)); }); } }); function someInternalFunction(obj...

Javascript object not initialized on slow connections

Here's the odd situation: we have a piece of javascript library that is being called on our onload of aspx page. It works everytime for us, but the clients that have low speed modems get an error, because the object is not getting initialized and the aspx page is already loaded.!! Is there any suggestions on how to call this piece of ...

I'm an ASP.NET programmer (Webforms). Should I switch to MVC?

I like having control over exactly what's going on under the hood (the MVC way), but I'm also lazy, and don't like writing tons of javascript GUI things. Should I or should I not switch to MVC? Thanks, Nestor ...

Problems setting breakpoints for JavaScript in Visual Studio 2008

I'm trying to debug JavaScript in Visual Studio 2008. I use ASP.NET MVC, jQuery, and jQueryUI. I can set a breakpoint, but when I start debugging Visual Studio changes the breakpoint icon to one with a warning. Hovering over the icon then reveals a tooltip which says: "The breakpoint will not currently be hit. The document is not lo...

XPath to find elements based on time values

I have the following XML, returned from a web service (5 extra points for guessing the movie): <ArrayOfSub xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/"&gt; <Sub> <SubId>862</SubId> <SubStreamId>1</SubStreamId> <SubTimeStart>00:01:04.4450000</...

jQuery plugin scope of settings passed in

I feel like this must have been asked, but I'm unable to find it through my searches. Here's a complete example of the issue that's confusing me: <html><head> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"&gt;&lt;/script&gt; <script type="text/javascript"> (function($){ $.fn.test...

Variable scope in the code

I was going over the tutorials for GWT and was confused by this piece of code. The code is at GWT tutorials private void addStock() { final String symbol = newSymbolTextBox.getText().toUpperCase().trim(); newSymbolTextBox.setFocus(true); // Stock code must be between 1 and 10 chars that are numbers, letters, ...

showing a hidden li on click jquery

Sorry for all the dumb jquery questions I'm still learning and find this to be a GREAT resource! How can I show a <li> on click of a class here is my html <li><a href="#" rel="sample.gif">sample.gif</a> <a href="#" class="edit_project_file"> <img src="images/edit.gif"/></a></li> <li class="edit_project_image" style="display:none;...

Firefox 3.5 support for client-side databases?

I was originally looking for a basic tutorial on how to get started using client-side databases in FF3.5. My understanding was that this feature is support in FF, Safari, and IE8. However, I'm running into a pretty basic problem, which is that the syntax to created such a database doesn't seem to be found in FF3.5. For example, to creat...