[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
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
?
274 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

650 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