This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pass Info to a popup window

 
Mkhaya Tini
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way to pass info to a pop up window?

say i've this function:

function getMeaning(hexmsg){

window.open ("../views/translate.jsp","mywindow","status=1");
}

what i need is to show the "hexmsg" variable in that popup window.

please help.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try searching the forum since it is asked many times here.

Eric
 
Mkhaya Tini
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, i kinda figured it out but again not really. I'm having a really weird problem:

I've a table. the content of each cell are unequal and when showing all, it does not look good. so, what i'm trying to do is, show only the first 30 letters and when click on these 30 letters a pop up window will show up and show the whole string. here is the javascript function i'm using:

function showAll(message){

var newWin = window.open ("../views/showmessage.jsp");
var fi = newWin.document.getElementById("shwmsg");
fi.value = message;
}

where shwmsg is a text field in the popup window. the weird problem is, it is working or not working - completely randomly. I click on the link, nothing happens. I mean, the popup window shows up, but the text field is empty. I keep clicking and may be after 5 times, the messages shows up in the text field. then again it does not show. after may be another 3/4 click it shows. if it works, it should work all the time, and if it does not it should never work. does anyone have a clue?

off topic, but if someone can give me another way of doing this besides pop up, i might try using that too. thanks.
[ October 11, 2005: Message edited by: Mkhaya Tini ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
off topic, but if someone can give me another way of doing this besides pop up, i might try using that too. thanks.


Use the title attribute to show the entire string as a 'tooltip' when the mouse hovers over the truncated string.

Or, use a floating div that emulates a 'tooltip' to show it.

I would personally not use a heavy-weight popup for this purpose.
 
Mkhaya Tini
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can u please tell me more about floating div please. an example or link would be nice. thanks or reply.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mkhaya please use real words rather than short-cuts like "u".

To "float" a div, use CSS to give it a z-index higher than any other, and to specify its dimensions and placement. The CSS display attribute can be used to show and hide the div (using values of 'block' and 'none', respectively).
 
Mkhaya Tini
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ToolTipText (title) is easy to implement but does not give the ability to print, which I need. Float is not working for this purpose either. can someone help me with sending a value to a popup window?

all i need is, create a popup from a main window, pass a value to the popup and show that value. anyone? thanks in advance.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stop it Eric, you're supposed to be on holidays
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by David O'Meara:
Stop it Eric, you're supposed to be on holidays


I am back! Wish I wasn't!

Eric
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, I though you were saying you were passing through. My mistake.

HTML/JS isn't the same withour you
 
Mkhaya Tini
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Eric Pascarello, it has been very helpful. another quick question for you, if you don't mind. is there a way to show the content of a javascript variable say var x ="Java Ranch" inside a paragraph?

so the final output will show the words "Java Ranch" but not in a text box or something like that but inside a <p>....</p> attribute.

the reason I need this is formatting. none of the <b>,<i> or stuff like those works in a textarea.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you assign an id to a span (or other containing element), you can replace or augment its content with the innerHTML property.



and in script


[ October 13, 2005: Message edited by: Bear Bibeault ]
 
Mkhaya Tini
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u are the man!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic