Jump to content

web_loone_08

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by web_loone_08

  1. needs to be like this: document.images[1].src;
  2. try this: <link rel=\"stylesheet\" type=\"text/css\" href=\"http://servername/note.php\" media=\"print\"/> <script type="text/javascript"> window.onload = function() { window.print(); } </script>
  3. <form id="hiddenQuoteSendOff" action="index.php?page=reply&id=230" method="post" style="display:none;"> <input type="hidden" name="quote_text" value="" /> </form> <a href="#" quoteThis();">quoteit</a> <script> function quoteThis() { var txt = ''; if (window.getSelection) { txt = window.getSelection(); } else if (document.getSelection) { txt = document.getSelection(); } else if (document.selection) { txt = document.selection.createRange().text; } else txt = ""; var hiddenForm = document.getElementById("hiddenQuoteSendOff"); hiddenForm.quote_text.value = "[quote] " + txt + " [/quote]"; hiddenForm.submit(); return false; }</script>
  4. you can add an onload() event to the actual body tag; that way it meets your requirements (not in the head or the body - but in the tag instead). <body onload="document.getElementById('focal_link').focus()"> echo "<br /><center><a id='focal_link' href='add_concert.php'>Add Another</a></center><br />\n";
  5. well...........i'll take a guess; if you want the full page included, you could use a SSI Virtual Include. if you only want to include the JS; just take everything from with inside of the script tags and put in an text file and save it as "something.js" and include it in your pages with an external JS link; like so: <script type="text/javascript" src="something.js"></script>
  6. do you want the JS in a separate file or both the JS and the HTML in a separate file?
  7. well in am using FF v2.0.0.17 & the page fully loads and it still just a normal jumpy anchor. edit: never mind - i see it working now
  8. @ProjectFear I don't see any smooth scrolling when I click on a letter in FireFox; it just jumps to the link, like a normal anchor. That prototype must not work in FF.
  9. This is called an "HTML Anchor" - this is not done with JS. Example <a href="#bottom">Go To Bottom of The Page</a> <div style="height:1000px"><!-- For Demo Purposes Only - Not Part of Actual HTML Anchor --></div> <a name="bottom">Welcome To The Bottom of This Page</a>
  10. are you talking about the links? if so; here is the complete css you need: <style type="text/css"> #dropmenudiv{ position:absolute; border:1px solid black; border-bottom-width: 0; font:normal 12px Verdana; line-height:18px; z-index:100; } #dropmenudiv a{ width: 100%; display: block; text-indent: 3px; border-bottom: 1px solid black; padding: 1px 0; text-decoration: none; font-weight: bold; color: #000000; } #dropmenudiv a:link { color: #000000; } #dropmenudiv a:visited { color: #000000; } #dropmenudiv a:hover{ /*hover background color*/ background-color: yellow; color: #000000; } #dropmenudiv a:active { color: #000000; } </style>
  11. O'Reilly has several of their books in PDF format now. http://oreilly.com/
  12. http://www.dynamicdrive.com/dynamicindex11/findpage.htm
  13. split the forward slashes and the get the array key edit: i just re-read your post - sorry - you wanted the position - why not just search the url for http or https? you still could split the first two forward slashes and get array key 1; that should give you the rest of the url (after http or https). example <script type="text/javascript"> var url="http://website.com/page.html"; var slashes = url.split("//"); alert(slashes[1]); </script>
  14. then your looking for a "toggle menu".
  15. that's good - glad you got the problem resolved - good luck with the other issues
  16. i think your looking for a "dynamic select menu" - do a web search for that keyword and see if that is what your looking for; you should be able to see a few examples of how to do this - during your search.
  17. Because you should be using DOM at this point and if you were; you probably could get this to work the way you wanted it to, but obviously there is a problem with using document.write() and a function - that is why IE is not letting you do this. You should be using UnObstructive JavaScript Practices and basically you don't comprehend - it's not gonna work the way you have it wrote; at least not cross browser.
  18. well unfortunately your method did not work in IE and my methods are cross browser; so you will have to choose how you want to do this - cross browser or browser specific only - up to you. also, you really should not use a function with document.write(); that is not the best method to do what your trying to do.
  19. that is your ajax code - that xtopolis just provided you: //CREATES A XMLHttpRequestObject function newXHRO() { try { return new XMLHttpRequest(); } catch(e) {} try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {} try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} alert("XMLHttpRequest not supported"); return null; } //Make call (pass the function an id function updateCtr(what) { var x = document.getElementById(what); x.innerHTML = 'Updating...'; var XHRO = new newXHRO(); var url = 'scriptname.php'; // CHANGE THIS TO YOUR URL XHRO. /> { if(XHRO.readyState==4 && XHRO.status==200) { x.innerHTML = XHRO.responseText; } } XHRO.open("GET",url,true); XHRO.send(NULL); } put your php script in a different page and name it "scriptname.php" (for example purposes only - name it what you want to; just make sure you define the "url" variable in the AJAX script above; with the same name). <?php session_start(); session_register("count"); $sessid = session_id(); if (!isset($_SESSION)) { $_SESSION["count"] = 0; echo "<p>Counter initialized</p>\n"; } else { $_SESSION["count"]++; } echo "<p>The counter is now <b>$_SESSION[count]</b></p>"; echo "<p>please reload this page to increment</p>"; ?> then in your html page; if your calling the function with link - do it something like this: <span id="counter"></span> Click <a href="javascript:updateCtr('counter')">here</a> to refresh the page.
  20. there is no array; because you really don't need an array for two variables - plus i eliminated the function - so yes - that is the simplest way to accomplish what you wanted to do. also why don't you just create a normal array (new Array()), add the number/variables to that and use a for loop to document.write() out each key? That makes more sense to me and it is browser compatible that way too.
  21. try this..... function validate() { var str = ""; var elements = document.getElementsByTagName('input'); var elements2 = document.getElementsByTagName('textarea'); // loop through all input elements in form for(var i = 0; i < elements.length; i++) { // check if element is mandatory; ie has a pattern var pattern = elements.item(i).getAttribute('pattern'); if (pattern != null) { var value = elements.item(i).value; // validate the value of this element, using its defined pattern var offendingChar = value.match(pattern); // if an invalid character is found or the element was left emtpy if(offendingChar != null || value.length == 0) { // add up all error messages str += elements.item(i).getAttribute('errorMsg') + "\n" ; // notify user by changing background color, in this case to red elements.item(i).style.background = "yellow"; } } // loop through all textarea elements in form for(var ii = 0; ii < elements2.length; ii++) { // check if element is mandatory; ie has a pattern var pattern2 = elements2.item(i).getAttribute('pattern'); if (pattern2 != null) { var value2 = elements2.item(i).value; // validate the value of this element, using its defined pattern var offendingChar2 = value2.match(pattern2); // if an invalid character is found or the element was left emtpy if(offendingChar2 != null || value2.length == 0) { // add up all error messages str += elements2.item(i).getAttribute('errorMsg') + "\n" ; // notify user by changing background color, in this case to red elements2.item(i).style.background = "yellow"; } } }
  22. like so..... document.Form_Name_Here.submit();
  23. did you add an onclick handler to the image; so DOM would know what to do - when click() was called? also note; that if you are trying to trigger click() onload - you could be running into browser security walls - if that is what your doing; then that may be why you are not able too get click() to work.
  24. i tested it in IE7 - looks like it works fine to me
  25. easiest solution: <script type="text/javascript"> var x = 3; var y = 7; document.write('a: ' + x + ', b: ' + y + '<br>'); </script>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.