javascript

Javascript function to change button colour

Can someone show me whats wrong with this: <html> <script type = "text/javascript"> function colourGreen() { document.getElementById("button1").style.bgColor = 0xFFFF00; } </script> <body> <form action=""> <div id = "button1"> <input type="button" valu...

How to position a pop up to be in the top right part of the screen

What I want to do is to change the size of a window and create a window next to it so they are exactly next to each other. In that sense, I need to position to the new window to the top right part of the screen, the way I am doing it is not working (code is below), I need help :) function () { var viewportwidth = document.documentEl...

Javascript passing parameters into function

Hey, i cant seem to get this to work, im a little confused on how im supposed to pass the colour paramaters: function colourGreen(red, green, blue) { document.getElementById("button1").style.backgroundColor = 'rgb(red,green,blue)'; } ............. ............. <input type="button" id = "button2" value="Pr...

How to automatically insert predefined text into a string in positions definable by a regular expression

I'd like to use javascript to search a string and automatically insert a closing tag before every occurrence of an opening tag. Here is the test code I've come up with so far: var str="<span>this <i>is</i> a <i>test</i></span>"; var patt1=/<(?!span)\b\w+>/g; var patt2=/<\/(?!span)\b\w+>/g; document.write(str.replace(patt1, '</b>' + str...

How to use the Really Simple History Javascript library?

Using Really Simple History http://code.google.com/p/reallysimplehistory/ When I use the following code, <body> <a href="#abc">abc</a> <a href="#abcd">abcd</a> <a href="#page=3&cat=4">page=3 cat=4</a> <a href="#page=3&cat=5">page=3 cat=5</a> <a href="#page=22&cat=33">page=22 cat=33</a> <script type="text/javascript" src="json2007.js"...

Pull specific XML node(s) into HTML document

Hi all, first time poster. Please be gentle. This topic may be similar to several other questions out there, but as far as I can see this is a unique problem I'm trying to solve. FWIW, I'm primarily a designer; I'm dangerous with Flash and HTML and CSS, but a bit in the weeds with everything else. From searching around, I appear to be...

How to you abort/cancel a request using the prototype js library?

Using this code: var pendingRequest = new Ajax.Request(myUrl, { method: 'post', postBody: soapMsg, contentType: "text/xml", onSuccess: function(transport) { doSomething(transport); }, onFailure: function(t) { ...

Ajaxify's History and Bookmarking not working on Chrome?

Ajaxify is quite a well known jQuery plugin. But I just used Chrome and try this page: http://max.jsrhost.com/ajaxify/demo.php for the New v2 features: History & Bookmarking. When I click on Link 1, 2, and 3, and click the back button on Chrome, the content is not refreshed. So for now, this feature doesn't work on Chrome? Is it be...

How can I record audio in a web app client side and save it in a web server?

I have a requirement to do a flash program or something like that (not necessarily flash, it can be javascript or something in aspnet) that allow me to save audio in the client side of a web app, and save it on a file in the server side of the web app. I've been searching a lot in google, and all I've found are just old questions, but n...

Make changes to a browser window once another window is closed

So, I have a browser window that if you click on a specific button on it, it opens another window next to it, resizes the first window and then puts the new window next to it. This is great, however, I want the first window (the original one) to go to full size when the 2nd one is closed. (Whenever the user closes the 2nd window he/she o...

how to make download box

I want to know how to make a download box in javascript. I want to make a set of data to a csv file and let the users be able to download this. Can someone please point me in the right direction? some links or some snippets of code would be nice. thank you! ...

Javascript not loading for php generated form

I am using phpBMS, and have made a form, similar to the sample provided. Using the provided input fields, I have made a basic dropdown list containing two items, and a checkbox. I want the checkbox to be selected automatically when one of the options from the dropdown box is selected. Jens F, provided me with a solution to how I shoul...

How to use JavaScript to "stop" and "play" video that's inside an FLV player?

Is it possible to use JavaScript to "stop" and "play" video that's inside an FLV player? I want to do this using only JavaScript and without modifying the FLV player or movies. The FLV player I must use is one of the default players bundled with Flash (FLVPlayer_Progressive). ...

dynamically create object tags in javascript

I am wondering why the following code does not create two of my activex object. When the object tag is directly in the HTML it works fine, but for the life of me I can't dynamically create the object item. Is this a security issue or something? I am finding a difficult time finding documentation on this problem. <%@ Page Language="C#"...

What's a good way to run Javascript Interactively?

For Ruby, we have irb. For Python, we have IDLE. For Javascrpt, is Firebug or Chrome on a blank page the best way to run or test Javascript interactively? ...

WordPress Theme Hack - How Do I Call Specific Child Pages Only

I'm going to try my best to explain this correctly :) This question is regarding a Wordpress Theme Hack and php. Currently we are using Coda Blue as a theme see here. Right now the jQuery slider is being controlled by li's that are the tabs of the slider (web design, social media, etc). The tabs are created by making a page, and the ...

How to check with javascript if connection is local host?

Hi I want to have a check in my javascript if the page loading up is on my local machine. The reason why I want to do that is that when I developing I like to make sure that both my server side(C#) validation is working correctly. So I like to see both the client side and server sides errors to show up. So while I am testing I have a ...

Why does Really Simple History Javascript library fire off event twice in IE but once on Firefox and Chrome?

The Really Simple History ( http://code.google.com/p/reallysimplehistory/ ) will fire off event once in Firefox and Chrome, but twice in IE (I am using IE 8). Does any one know why? <body> <a href="#abc">abc</a> <a href="#abcd">abcd</a> <a href="#page=3&cat=4">page=3 cat=4</a> <script type="text/javascript" src="json2007.js"></script...

jqGridmin.js produce error in FF when doing quick switching between grids

When I'm attempting to switch between filters and loading up different jqGrids in succession, I sometimes get this error in FF: i.p is undefined (line 108), which is this line: j.p.lastsort=b.inArray(j.p.lastsort,f);if(j.p.treeGrid)j.p.expColInd=b.inArray(j.p.expColInd,f)},setGridWidth:function(f,k){return this.each(function(){var i=th...

I have javascript code that splits the screen, however, how do I run it from a flex application?

So, this code splits the screen into two frames: Javascript:A14nH=location.href;L3f7="http://www.google.com";R1Gh7="http://www.google.com";if(L3f7&amp;&amp;R1Gh7){Fr4Q='&lt;frameset%20cols=\'*,*\'&gt;\n&lt;frame%20src=\''+L3f7+'\'/&gt;';Fr4Q+='&lt;frame%20src=\''+R1Gh7+'\'/&gt;\n';Fr4Q+='&lt;/frameset&gt;';with(document){write(Fr4Q);voi...