Jump to content

Ajax help


tyweiss

Recommended Posts

Basically I'm a 'struggle' right now, I'm pulling in different content from a file (by XMLHttpRequest) and since I'm doing that the page only loads once...just content changes as they click next. Therefore I cannot set the element I want to hidden with the onload() in the body or any other tag.So instead I tried to use a div and set it to hidden but when I pull that content into the other page...there it is plain as day...and I can't get it to hide initially when I pull in that content.part of the content i'm trying to pull into the page (below)tester(), a function on the main page that is pulling this content in, will make it visible when the link is clickedproblem with syntax? or my logic in how I think Ajax works? <a href='#' onclick='tester();'><span style="color:red">Click Here...</span></a> To Generate a P/O Reference # to Provide to the BrandManufacturer <br /> <br /> <div id='po_reference' align="center" style='visibility.hidden'><span style="background-color: yellow">Your P/O Reference # is: #P/O Reference goes here# </span> </div> <script type="text/javascript"> document.getElementById("po_reference").style.visibility="hidden"; </script>as you see I tried hidding it using a div ...then i tried just having a script with getElementById() in the content being pulled that would set it to hidden.anyone have a different angle to approach this, or maybe some things to try? I'd appreciate any help or ideas you could throw my way.

Link to comment
Share on other sites

Instead of using visibility, use display. You have your syntax wrong in the style tag for the div also. "visibility.hidden" isn't a valid value for the style tag. Anyway, use display.<div id='po_reference' align="center" style='display: none;'>You can delete the Javascript after that. To set it to display change the display style to "block" instead of none.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...