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
251 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
  • 2
4 Comments
 
LVL 10

Expert Comment

by:aboo_s
Comment Utility
showOrHide() should be show()
0
 

Author Comment

by:westdh
Comment Utility
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 500 total points
Comment Utility
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
Comment Utility
thanks
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now