Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

What's my code missing?


  • Please log in to reply
4 replies to this topic

#1 DnDer

DnDer

  • Members
  • 646 posts
  • OFFLINE
  •  
  • Local time:03:26 AM

Posted 25 August 2009 - 10:04 AM

How does a <a href='http://intranet/FAQS/[FAQ item].htm' onclick="return new_window('http://intranet/FAQS/[FAQ item].htm');" target="test">[FAQ Item]</a> work?

I copied and pasted, then used the new link. I don't know how to Javascript. I'd like this window to fit all the text inside. (The original did. But it was also a much shorter block of text.) What variables do I need to put in there to do this?

BC AdBot (Login to Remove)

 


#2 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,260 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:01:26 AM

Posted 25 August 2009 - 12:57 PM

Try this instead:

<a href="java script:window.open('foo.html', 'MyPopup', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=250,left = 470,top = 325');">Foo</a>
Note: remove the space between java and script to make this work.

Where foo.html is the page to be opened, MyPopup can be any string and the parameters toolbar, scrollbars, location, statusbar, menubar, and resizable are booleans (0 = turn that feature off, 1 = turn that feature on), width and height control the size in pixels of the window, and left and top control its position in pixels relative to the top and left edges of the screen.

All the parameters but the first two are optional.

Be warned: this method if user interface design is largely depreciated and considered bad design. Many modern browsers enable the user to override or disable the controls and restrictions available to the developer in this case. For example, Firefox can be set to ignore the parameter=0 restriction and even to force such windows to open in a new tab instead of a popup.

Edited by Amazing Andrew, 25 August 2009 - 12:58 PM.


#3 DnDer

DnDer
  • Topic Starter

  • Members
  • 646 posts
  • OFFLINE
  •  
  • Local time:03:26 AM

Posted 25 August 2009 - 02:11 PM

It's just something that's quick and dirty for our intranet for the company, and serves its purpose.

Now, what I am interested in is can you set it so that the window opens to the size of the text, assuming the length of the text is less than the height of the screen, of course...

#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:26 AM

Posted 25 August 2009 - 02:41 PM

Now, what I am interested in is can you set it so that the window opens to the size of the text, assuming the length of the text is less than the height of the screen, of course...

The short answer is no. The long answer is yes, but it would be incredibly complex, and not something that someone who does not "know how to javascript" is going to accomplish. The problem is that unless you know for sure that the text is going to be a certain font, of certain size, and of certain length, then you can't assume anything at all.

#5 DnDer

DnDer
  • Topic Starter

  • Members
  • 646 posts
  • OFFLINE
  •  
  • Local time:03:26 AM

Posted 25 August 2009 - 02:43 PM

Thanks for that! I'll just have to experiment with which "height" works.

Also... how do you "casually" mention something like labor pains? XD




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users