Solved

Html: how can I hide this line untl a certain event occurs

Posted on 2011-09-11
2
172 Views
Last Modified: 2012-05-12
how can I hide this line untl a certain event occurs

<a id="ExpColLink" href="javascript:showOrHide('ExpColLink');"> <p class="slide" align="center"><font size="1">Select a listing & click here to View Map</font></p></a>

----- I have no way of excuting this function??

<script type="text/javascript">
 function show()
   {
       if (window.location.href.indexOf("RecordID")>0)
       {
document.getElementById("show").style.display = "block";
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 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
ID: 36519578
How about on page load?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled</title>
<style type="text/css">
</style>
</head>
<body onload="javascript:showOrHide('ExpColLink');">
<a id="ExpColLink" href="javascript:showOrHide('ExpColLink');"> <span class="slide" style="text-align:center;font-size:1em">Select a listing & click here to View Map</span></a>
<script language="JavaScript" type="text/javascript">
 function showOrHide(ele) 
   {
       if (window.location.href.indexOf("RecordID")>0) 
       {
            document.getElementById(ele).style.display = "block";
            alert("your url contains the name RecordID");
       } 
       else 
       {
            document.getElementById(ele).style.display = "none";
       }      
      
   }
</script>
</body>
</html>

Open in new window

0
 

Author Closing Comment

by:westdh
ID: 36523133
Thanks
0

Featured Post

Independent Software Vendors: 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

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
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)

734 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