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
260 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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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'…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

717 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