?
Solved

I would like to have this hyperlink link active if a value in the URL exists like 'RecordID'

Posted on 2011-09-10
4
Medium Priority
?
267 Views
Last Modified: 2012-06-21
I would like to have this hyperlink link active if a value in the URL exists like 'RecordID'

<div id="show" style="display: none">
    <a href="javascript:showOrHide();"><p class="slide" align="center"><font size="1">Show/Hide Map View</font></p></a>
</div>

  this js does not work?

 <script type="text/javascript">
  function show()
   {
       if (window.location.href.indexOf("RecordID"))
       {
           alert("your url contains the name RecordID");
       }      
     
   };
  </script>
0
Comment
Question by:westdh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Expert Comment

by:aboo_s
ID: 36517176
showOrHide() should be show()
0
 

Author Comment

by:westdh
ID: 36517281
That's not it or I have not explained what I hope to have done.

I do not want the Hyperlink to show until the user clicks on another link on a previous page, which i see at the bottom of the browser, a URL that has a value in it called 'RecordID'. I was hoping that I could use the div tag to not show the Link until I tested the Url for that value in the string.
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 36517801
add >0

window.onload = function() {
        show();
}

  function show()
   {
       if (window.location.href.indexOf("RecordID")>0)
       {
document.getElementById("show").style.display = "block";
           alert("your url contains the name RecordID");
       }      
     
   };
0
 

Author Closing Comment

by:westdh
ID: 36518101
thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question