Hi again Masters Of Web Programing.
Another maybe stupid question:
I have got this javascript for uploading files to my server (named it "upload.js"):
function startUpload(){
document.getElementById('upload_form').style.visibility = 'hidden';
return true;
}
function stopUpload(success){
var result = '';
if (suc...
Performance is of the utmost importance on this one guys... This thing needs to be lightning fast!
How would you validate the number of days in a given month?
My first thought was to make an array containing the days of a given month, with the index representing the month:
var daysInMonth = [
31, // January
28, // February
...
hello, here is my code:
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>
</head>
<body>
<div id="example">
</div>
<script type="text/javascript">
function insert() {
var data = '<script type="text/javascript"> function test() { a = 5; }<\/script...
I am using below code to inject javascript
HtmlElement head = _wb.Document.GetElementsByTagName("head")[0];
HtmlElement scriptEl = _wb.Document.CreateElement("script");
mshtml.IHTMLScriptElement element = (mshtml.IHTMLScriptElement)scriptEl.DomElement;
element.text = "function zoom(){do...
Hello guys... This code works fine in IE8/7 and Firefox... But in Google Chrome i got a problem...
My page have a menu, when the user click it, hide div blocos and shows the content (using url parameter setted in menu)
My Jquery Code:
$(document).ready(function() {
$('div.blocos').hide();
$('div#divMenuBloco').show(...
I want to replace the smart quotes like ‘, ’, “ and ” to regular quotes. Also, I wanted to replace the ©, ® and ™. I used the following code. But it doesn't help.
Kindly help me to resolve this issue.
str.replace(/[“”]/g, '"');
str.replace(/[‘’]/g, "'");
...
I have a default page which loads different controls on pageload according to the querystring.
I have a control which creates checkbox list (inside div_A) on load and get checkbox checked through database, then i click Continue, div_A get invisible with all the checked checkbox id in hidden field and div_B is visible true.
On Go Back cl...
I've got a rather hideous and large javascript file that I've inherited from a dev I loathe. There is a lot of dead code, and I find I've spend a lot of time refactoring functions that aren't even called.
Ideally, I just want something that can tie into the js engine and keep track of when and how many times functions are called.
In F...
How would you implement different types of errors, so you'd be able to catch specific ones and let others bubble up..?
One way to achieve this is to modify the prototype of the Error object:
Error.prototype.sender = "";
function throwSpecificError()
{
var e = new Error();
e.sender = "specific";
throw e;
}
Catch specif...
Hi,
i have an ActiveX Object (Master) and would like to invoke functions dynamically on it. To do this i use the apply() Function. But sadly the InternetExplorer tells me something along the lines of: "This Object doesn't support this Method". Can someone give me a hint what i could do?
(To test this you also could use a small flash obj...
Hello,
I know there maybe ugly hacks to achieve this, which is why I am asking this. Basically I have a video chat window, so I want to allow resizing of window, but I would like to force the ratio (so that it is maintained). I guess I can run a javascript which refreshes every X seconds and resizes the window.
Any good ideas? I don't...
I am pulling data from a database with Ajax and dynamically populating a div tag with image elements. The image file name corresponds to the data in the database.
For instance if there was something in the database called 'foo', I have an item called 'img/foo.jpg'
My javascript pulls the data and creates a an image with the src if 'img...
This should be an easy one, but im having troubles. I have an iframe that loads an .aspx page. This .aspx page (one in the iframe) has javascript that im using to try and access an element on the main page, but it can never seem to find it.
ie:
Here is the .aspx page that loads the iFrame.
<body>
<form id="form1" runat="server">...
When posting a link to your facebook profile, users are presented with the option to choose a thumbnail to represent the link, as seen in the following example:
http://www.everyday.com.my/photo/2009/4/Add-Sushi-King-into-my-Facebook-profile.jpg (New users aren't allowed to embed images)
The thumbnails presented to the user are the diff...
I use the following code to delete a character when the user presses the delete code.
It works in Firefox but doesn't work in Google Chrome.
What do I have to fix?
window.onkeypress = function(key) {
...
if (Guessing>0){
else if (key.keyCode == 8){//Delete key
PhraseEntry=PhraseEntry.substri...
I have a page that renders differently in each flavor of IE7.
IE7 for vista is a different version than IE7 for XP, and they have subtle differences between them. This results in having the two versions render my page differently. The same, of course, goes for IE8 in compatibility mode.
What I need is a list of every version of IE7 out...
Hey there... here's an easy one (that I'm struggling with)! I have a textarea, a button, and an empty div. All I want to do is insert the updated contents of the textarea into the div onClick of the button. Here's what I've got so far:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascr...
I have a container element that you can drag objects around in. I want it it so that if you drag an element out of the container (when the mouse crosses the border of the containing div) the element you're dragging to change. How do I arrange this?
$("#container img").draggable({
helper: 'clone',
zIndex: 100
});
Once the imag...
Hi
I am looking to use this plugin: http://keith-wood.name/countdown.html
but I need to use the TimeZone feature of it. So I was looking at the sample code
$('#sydneyCountdown').countdown({until: liftoffTime, timezone: +10});
so +10 is the TimeOffSet number. Now I need to make it so I can do a jquery get request and grab the TimeOf...
I'm working on the Web GUI of an appliance-like product.
I have an HTML form that works fine: it shows a list of things with checkboxes, the user checks some of them and clicks the "remove" button which submits the form. The server gets the POST, removes the items, and refreshes the page. All fine.
There's a requirement to add an "ar...