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
253 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

773 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