Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by jesh

  1. One solution would be two call both of your functions in a third function which is assigned as the handler. function one(){ alert("one");}function two(){ alert("two");}function init(){ one(); two();}window.onload = init;
  2. jesh

    Domain Names

    It typically isn't your browser's job to keep track of that. It's your ISP's job.
  3. function CloseWindow(){ window.opener.location.href = "456.html"; window.close();}
  4. <a href="#TemplateInfo" onclick="return false;">Doesn't do anything</a> The fact that your onclick handler returns false makes it so the default action of clicking on the link is ignored. If you want the onclick to happen and then have the page focus on the element with the id of "TemplateInfo", then get rid of that return false.
  5. jesh

    Quick Function Help

    <html><head><script type="text/javascript">function saySomething(text){ alert(text);}saySomething("The page hasn't loaded yet...");window.onload = function() { saySomething("Here we are, the page has loaded..."); }</script></head><body><div>This is in the body.</div></body></html>
  6. Check out DataGrid and/or Repeater controls.DataGrid: http://msdn.microsoft.com/en-us/library/sy...s.datagrid.aspxRepeater: http://msdn.microsoft.com/en-us/library/sy...s.repeater.aspx
  7. I think you're almost there.This function appears to be looking for a select element: function setSize(selected) {var size=selected.value.split("/");document.getElementById("setWidth").value=size[0]document.getElementById("setHeight").value=size[1]} But you're passing an index (i.e. a number): <select name="formatet2" onchange="setSize(this.selectedIndex)" > You might try modifying your javascript function to be something like this: function setSize(select){ var size = select.options[select.selectedIndex].value.split("/"); document.getElementById("setWidth").value = size[0]; document.getElementById("setHeight").value = size[1];} Then use it like this: <select name="formatet2" onchange="setSize(this);">
  8. The code that Dad provided works for me in Firefox and IE6 in a test I did: <html><head><style type="text/css">body {background-color:red;}div {width:100px;height:100px;background-color:white;opacity:0.5;filter:alpha(opacity=50);}</style></head><body><div></div></body></html>
  9. For a setup where you need to test whether a number is odd or even, the modulo operator that Dad mentions is the way to go. For a simple setup like you've described, you could also use a for loop where the iterator is initialized at 2 and is incremented by two over each iteration.
  10. You're not quite right there. If your HTML looks something like this:<img src="1.jpg" /> Then you can set up the onclicks like this: for(var i = 0; i < picts.length; i++){ picts[i].onclick = function() { window.open("big_" + this.src); }}
  11. I would have tested earlier, but getting coffee was the more important task at hand. Now that I'm satiated, the following works just fine in IE6: function test(){ return {"Name":"jesh", "Version":1};}var obj = test();alert(obj.Name);alert(obj["Version"]);
  12. 1) First make sure that the column CFDExpirationDate allows null values.2) Try setting CFDExpirationDate to NULL rather than 'NULL', as in: UPDATE ContacttestSET CFDExpirationDate = NULLWHERE (CONVERT(varchar(11), CFDExpirationDate, 1) = '12/31/2008')
  13. jesh

    Syntax Problem

    I have to admit that I have much more experience using SQL Server than I do using MySQL so I may be of less help to you than others in this forum.Have you looked on Google for how to change the root password for MySQL?http://www.cyberciti.biz/faq/mysql-change-root-password/http://www.simplehelp.net/2008/11/26/how-t...-root-password/Also, in looking at the documentation for the encrypt function, it says this: That would mean that each time you ran encrypt('abcde') you'd get a different result since you aren't passing a salt argument. You might want to read the documentation about encrypt() and password():http://dev.mysql.com/doc/refman/5.1/en/enc...unction_encrypthttp://dev.mysql.com/doc/refman/5.1/en/enc...nction_password
  14. To get all of the images that have a class "pict", you can do something like this: // This array will hold all of the images that have// a class name of "pict"var picts = [];// This is the array of all img elements in the document.var imgs = document.getElementsByTagName("img");for(var i = 0; i < imgs.length; i++){ if(imgs.className == "pict") { // This img element has a class name of "pict", let's // add it to our picts array. picts.push(imgs[i]); }}// Now you can iterate through the picts array and do whatever you want// to them (e.g. add an onclick handler)for(var i = 0; i < picts.length; i++){ // do stuff to picts[i];}
  15. This is a perfect use for JSON. You could have a return statement in your function like so: function getVersionNameAndNumber(){ ... return {"Name" : bName, "Version" : bVersion};} And then use it like this: var results = getVersionNameAndNumber();alert(results.Version);// or// alert(results["Version"]);
  16. I've only been using jQuery for a couple months now. I pretty much have to have the documentation open in one of my browser windows while I'm developing because I haven't memorized all of the functions yet.
  17. http://www.w3schools.com/html/html_links.asp
  18. No problem. It took me a long time to come around to it myself. I feel slightly dirty using it, but it's so incredibly easy. :)This in jQuery: $("#toggle").click(function(){ $("a").toggleClass("test");}); would look something like this in regular java script: var el = document.getElementById("toggle");if(el){ el.onclick = function() { var links = document.getElementsByTagName("a"); for(var i = 0; i < links.length; i++) { if(links[i].className.indexOf("test") > -1) { links[i].className = links[i].className.replace(/\btest\b/,""); } else { links[i].className += " test"; } } }}
  19. jesh

    Syntax Problem

    What you're looking at is the structure of the table, not the data that is contained in that table. The "sdtrusfX0Jj66" is the default value that would be assigned in the crypt column for a record that passed in a null value for that column. If you want to see the data, you have to run a select.Try this something like this: SELECT crypt, encrypt('abcde')FROM users WHERE id = 'root@localhost' If those two columns come back and have the same value, then the value that is in the database matches your encrypted "abcde" password.
  20. $("a").toggleClass("test"); http://docs.jquery.com/Attributes/toggleClass#classEDIT: All together it would be something like this: $("#toggle").click(function(){ $("a").toggleClass("test");});
  21. jesh

    Syntax Problem

    Have you tried something like this? UPDATE usersSET crypt = encrypt('abcde')WHERE id = 'root@localhost'
  22. The jQuery selectors are similar to CSS.Check out the documentation:http://docs.jquery.com/SelectorsYou want to get at the click event of an element with an ID of "toggle"? Try this: $("#toggle").click(function(){});
  23. jesh

    Html Colgroup Tag

    Yes. Until it is better supported (if that ever happens), you'll probably use it three times in an entire career. I've used it twice in 15 years.
  24. Check this page:http://www.w3schools.com/tags/att_table_frame.asp EDIT: By the way, I only just learned about this attribute because of reading your topic today. I have never come across it on any other web page that I've seen the source of and, like I said earlier, it isn't fully supported by Internet Explorer.
  25. It's because the td has a specified height of 600 pixels and the text inside takes up less space than 600 pixels and td elements, by default, vertically align their contents in the center. You can change this line:<td width="568" height="600" align="left" class="news"> To: <td width="568" height="600" align="left" class="news" valign="top">
  • Create New...