Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

link to close the div

Posted on 2007-11-16
4
Medium Priority
?
761 Views
Last Modified: 2010-08-05
when that script shoots the div stick to the screen...
what link i got to add to <a href or onclick=...
in order that the div that was open will be gone
?

please help, i'm massing with that for all day now...tried a lot of scripts and nothing works
set page = new AjaxedPage
page.draw() 
 
sub init() : end sub 
 
 
sub callback(action) 
if not rstemp.EOF and action = "poll" and session("alertime")<>ptime then
session("alertime")=ptime
page.return(poll())
end if
end sub 
 
 
 
function poll()  
  poll = "<p style='background:#000000;color:#ffffff;font-size:20px;'>" & palert & ptime & "</p>"
end function
 
 
sub main() 
%> 
<script>  
var tId=""; // create global variable to hold the interval handler 
function pollDB() {
 /* call the server and when return, call the javascript function showResult with the result */   
ajaxed.callback('poll', showResult);
  
} 
function showResult(result) {    
$('res').innerHTML = result; // put the result into the div with id="res"
} 
// onLoad (or set the same in the page load asp thingy ) 
window.onload=function() { tId=setInterval('pollDB()',6000); 
}
 
</script> 
 
 
      <div id="res" style="position:absolute; left:210px; top:290px"></div>
 
<% end sub %>

Open in new window

0
Comment
Question by:sasha85
[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
  • 2
4 Comments
 
LVL 17

Expert Comment

by:gops1
ID: 20300808
<a href="#" onclick="document.getElementById('res').style.display='none';">Close Div</a>
0
 
LVL 17

Assisted Solution

by:gops1
gops1 earned 450 total points
ID: 20300820
You can add return false as well.
Rank: Wizard
gops1:
<a href="#" onclick="document.getElementById('res').style.display='none';return false;">Close Div</a>

Open in new window

0
 
LVL 18

Accepted Solution

by:
Morcalavin earned 1050 total points
ID: 20300988
@sasha85

I answered this in your last question that is still opened.
0
 
LVL 18

Expert Comment

by:Morcalavin
ID: 20301152
Thanks.  New rank for me(guru).  Weeee!
0

Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

715 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