Jump to content


  • Posts

  • Joined

  • Last visited

About aaronjones3593

  • Birthday 01/01/1990

Contact Methods

  • Website URL
  • ICQ

aaronjones3593's Achievements


Newbie (1/7)



  1. onclick="window.open('page.htm','main')"onclick='window.open("page.htm","main")' Just so you can use either single or double quotes...
  2. you CAN close a popup window from another window when it is clicked using the following:function doPopup(){windowOne = window.open("somepage.htm", "windowOne", define_dimensions_and_sizes_here, "_blank");openedPopup = true;}windowOne = "";openedPopup = false; Then: In Main window:<body onfocus="if(openedPopup){windowOne.window.close();}">In popup window:<body onclick="self.opener.openedPopup=false; window.close();"> With the object: <input type="button" value="Testing" onmouseover="doPopup()">Or<input type="button" value="Testing" onclick="doPopup()">
  3. He could try this, I found it on a open source website (i think it was dhtmlcentral) where you mouseover an object and it displays a moving floating div, that moves with the mouse. u can download the source code js file from the website belowDHTML Centralthen click download sourcecode and imagesIt does say it only works for links, but you can use it for anything that supports the onMouseover event, which means it should be cross-browser.
  4. Add the mailto:your_email_address bit into the form tag.<form action="mailto:crazy34502001@yahoo.com"><!-- Form Items Here --><input type="submit" value="Send"></form> The data will be in RAW format, like so:Text field called textfield1 and textarea called textarea1, both fields contain the words "test email" without the quotes. When the user submits the form, you get sent an email containing the following:textfield1=test+email&textarea1=test+emailSpaces are "+" and seperate fields are "&" and field names are before the "=" and values are after the "=". Only way to do it without server-side scripts.
  5. eval() is a function to evaluate a piece of javascript code, like so:eval("alert('Hello')"); Notice two things:1: The code must be inside quotes ( "" )2: The code inside the quotes cannot end with a semi-colon ( ; ), which means you can only evaluate 1 line of code at a time.I had to use eval() when I made my own game...
  6. Try this: <html><head><title>Blah blah</title><script language="JavaScript">function resetAllItems(){ for (i = 0; i < itemIds.length; i++) { document.getElementById(itemIds[i]).style.display = "none"; }}function expandItem(itemId){ resetAllItems(); document.getElementById(itemId).style.display = "";}var itemIds = new Array();itemIds[0] = "divSearchForm";itemIds[1] = "divOtherThing";itemIds[2] = "divLastDropDw";</script></head><body bgcolor="#FFFF00" link="#FFFFFF" alink="#FFFFFF" vlink="#FFFFFF"><!-- Navigation Menu Start --><div id="divMainMenu" style="background-color:green;"><a href="JavaScript:expandItem(itemIds[0]);">Search</a> -<a href="JavaScript:expandItem(itemIds[1]);">Other thing</a> -<a href="JavaScript:expandItem(itemIds[2]);">Last thing</a> -<a href="JavaScript:resetAllItems();">Collapse all</a></div><!-- Navigation Menu End --><p> </p><div id="divSearchForm" style="display:none;">Your search form here</div><div id="divOtherThing" style="display:none;">Some other thing here</div><div id="divLastDropDw" style="display:none;">I dunno, getting bored now</div></body></html> Dont forget to populate all "subitems" in the array itemIds.Tried and tested, don't know if it is cross-browser compatible, works in IE 4.0+Hope this helps, don't know if it is what you were looking for. :)Email me for the file I saved it as when I was testing it.
  7. Hmm, you got me stuck there.Try this: var something = "64.83657639"; // Number you want to format, must be in quotesvar decimalPos = something.indexOf(".");var otherthing = something.substring(0,decimalPos + 3);var decimalPlc = parseInt(something.charAt(decimalPos + 3));if (decimalPlc > 5){ otherthing = parseFloat(something.substring(0,decimalPos + 3)) + 0.01;}var finalOutpt = "£ " + otherthing; EDITED FOR SUPPORT OF NUMBERS GREATER THAN 9.99Where finalOutpt would be the variable containing the formatted version of the number.The number you want to format must be enclosed in quotes (Must be treated as string) otherwise you would get a object does not support this method error.Hope that helps, I did test it and it does work, but don't know whether it was what you were looking for.
  8. Only way i can think of is something like bradly.lee's approach.var someWindow = window.open("somepage.htm", "_blank");someWindow.document.writeln("Hello"); // Would write "Hello" into the POPUP windowsomeWindow.alert("Hello"); // Would create an alert box in the POPUP window I know this works before because I have used it in my JavaScript Login and Admin Management Software...
  9. Set the onUnload event into the body tag to open the page when the event triggers.somepage.htm : <html><head><title>Blah blah</title></head><body onUnload="if (document.getElementById('someTextarea').value=='')window.open('somepage.htm', '_blank');"><textarea id="someTextarea"></textarea></body></html> or if you dont like to use inline java script: <html><head><title>Blah blah</title><script language="JavaScript">function checkIfNothing(){ if (document.getElementById("someTextarea").value == "") { window.open("somepage.htm", "_blank"); }}</script></head><body onUnload="checkIfNothing();"><textarea id="someTextarea"></textarea></body></html> Be warned ! the onUnload event also fires when the page is refreshed.
  • Create New...