Jump to content

niche

Members
  • Posts

    3,671
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by niche

  1. I'd use the onload event and add to the counter each time a page loads. I 'd want to save the data in a table so I'd do an AJAX call too.
  2. "I see", said the blind man. That's a nice satisfying conclusion to a light informative topic. Thank you So Called, Ingolme, and CodeName.
  3. I think I understand except I wasn't able to get the function to work, with it in the head. I had to move it to the end of the script. Is that why the alert doesn't activate from the previous post?
  4. Added the quotes and moved the JS to the end of the script. I suppose that demos how JS executes. I didn't think the JS executed until the onclick, but apparently it does right?
  5. Thanks, but no go. What do you think? Current Script: <html><head><script type="text/javascript">function displayText() { var hello = <?php echo $php_var; ?> alert(hello);}</script></head><body><?php $php_var = "Hello World!"; ?><button onclick="displayText()">Display</button></body></html>
  6. Just curious. How do you turn a php var into js var and back? Using a format like this: <html><head><script type="text/javascript">function displayText() { var hello = ??? PHP HERE ??? alert(hello);}</script></head><body><button onclick="displayText()">Display</button></body></html>
  7. The class is the styling. Find the "textarea" class in your CSS file and change it to what you need. EDIT:If you want styling for a specific item, create a new class and assign it to that item.
  8. Please read this then let us know what you need. http://www.w3schools...body_onload.asp
  9. Also, your VALUE statement in the query isn't concatenated.
  10. It worked. I forgot to change the id reference in the JS. Thanks to CodeName and ShadowMage for their help.
  11. Yes. Thanks. How did you know where to use that ref that way?
  12. I may not be following you. Are you saying is how to define the style for all IDs beginning with: itemInfo? <style type="text/css">[id^=itemInfo] { position:absolute; background-color: yellow; width: 300px; height: 50px; margin: 0px 0px 0px 105px;}</style>
  13. That's the way to define the ID selector?
  14. What's the notation for the CSS for all the IDs the begin with: itemInfo? #itemInfo???? Can it work that way?
  15. I see it. I needed to close the div. I also changed the position to absolute. On to the next issue. Thanks for keeping me on track ShadowMage!
  16. I just discovered that hover doesn't work on my mobile device. So, I'm trying to create a similar effect with JS. My problem is I can't get my hidden div out of the flow. I load my page like this and the hidden div disrupts all the placement around the button when it appears. What to do? echo '<button class="button0" onclick="showDiv(this.value)" value="xyz">Item Info</button>';echo '<div id="linkContainer2" style="display:none;"></div>'; CSS:#linkContainer2 { background-color: yellow; width: 300px; height: 50px; margin: 0px 0px 0px 105px;}
  17. Since you're using the W3schools script as the base, how are you sending the request to your php script?
  18. Both of us get to do better now that we know better!
  19. That was it. For everything there is a first time. I didn't have that distinction in my head until now. Thanks again dsonesuk and for your effort So Called. Also, I appreciate your comment justsomeguy. That probably wouldn't have occurred to me.
  20. This makes my div appear (when the display attribute is set to none) using the onclick event: divTest = document.getElementById('linkContainer2');if (divTest.style.display === "none") { divTest.style.display = '';} I thought this would make it appear and disappear (depending on the display attribute) using the onclick event, but it doesn't. Why? divTest = document.getElementById('linkContainer2');if (divTest.style.display === "none") { divTest.style.display = ''; } elseif (divTest.style.display === "") { divTest.style.display = "none"; }
  21. niche

    Combine: two tables

    http://www.w3schools.com/sql/sql_join.asp
  22. Lots of good advice. Thank-you for your help Don E, Ingolme, and eTianbun. Sorry it took so long to thank you. I was out for a couple days.
  23. How do you create an id for an element? I successfully created a paragraph with: var newLink = document.createElement('p'); //create paragraph and tried (unsuccessfully) to create an id with: newlink.setAttribute('id', 'noSug'); What's the right way?
  24. Thanks Ingolme. Your help is always appreciated.
  25. is there a function to delete dupes in a comma delimited string? If so, what is it please? if not, is an implode/explode with an array_unique() as good a way as any?
×
×
  • Create New...