Jul 25, 2008

Opening Hyperlink In New Window Using Xhtml 1.0 Strict

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > HTML, XML etc..

free web hosting

Opening Hyperlink In New Window Using Xhtml 1.0 Strict

csp4.0
My website (currently under construction) is all going well until I realized that the XHTML 1.0 Strict DTD does not allow the target="_blank" attribute. How would I find a way around this? I'm used to using XHTML 1.0 Transitional, but I want this website to be Strict for a change.
I would really like it if someone here at trap17 can give me some css that allows them to be opened in a new window.

I have searched on Google and only found ways that include writing my own DTD (which I don't want to do), use javascript, and use another doctype.
All of those things, I don't want to use. So it would really help if there is any way at all to open up a new window using CSS.

Reply

jlhaslip
Nope, can't be done via CSS with an XHTML Doctype.

Javascript would be the recommended method, but consider that the rule against opening up new windows is there for a reason. Let the client decide which windows (tabs) get opened in a browser... that is the intent of the restriction in XHTML.

Reply

rvalkass
In this era of tabbed browsing, different browsers take different understandings to being asked to open a link in a new window. Some take this literally, and so open an entire new browser window, while others take the logical route of opening a new tab. Then there is the possibility that the person viewing your site has ad-blocking or popup-blocking software running. They may well automatically prevent your link from opening a new window. As you can't necessarily be sure what will happen, it is best to go with something that will work instead. Let the browser and user decide what to do. Leave your link with no target, then the user can decide to open a new tab or window if they want, or to open the link in the existing tab/window.

Reply

bthaxor
i think in this case, the only method is to use javascript.

i don't understand why you don't want to use javascript - javascript has got to be my favourite web-designing language, since you can do almost anything with javascript (if you really tried, and used document.write a lot, you could even (try to) design a whole webpage with javascript!).

i just found a handy code that i used to use (used to because i don't care about validation anymore - all i care about is if it works in all browsers, since my document comes up with 100 errors anyway. i prefer to stick to ' target ="_blank" '). it is javascript, cross-browser and works 100%:

CODE
addLoadEvent(externalLinks);

function externalLinks() {
  if (!document.getElementsByTagName) return;
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute("href") &&
      anchor.getAttribute("rel") == "external")
      anchor.target = "_blank";
    }
}
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}


then, all you have to add to your links is ' rel="external" '. an example:

CODE
<a href="somepage.html" rel="external" title="this page opens in a new window">new window link</a>


hope i helped.

 

 

 


Reply

csp4.0
The reason I don't want to use javascript is the fact that I am using a redirection service (www.freedomain.co.nr) and it requires that I put a picture linking back. I can't modify the code so that is why I want a CSS code that opens the normal anchor tags in a new window and manually putting the nostyle tags in the ones I don't want to open to a new window.

But now that I think about it. There doesn't look like a way to do it in the original way, so I guess that the javascript way is the only way. Or I might just 'cheat' and write my own DTD... hehe happy.gif

Reply

Liam_CF
Instead of .co.nr you can use .uni.cc which works.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : opening, hyperlink, window, xhtml, 1, 0, strict

  1. Surf Internet Without Opening It. Useful For School
    How-to! (5)
  2. Opening Nat Requests
    (0)
    I remembered what service i offered to my clan when I saw the topic about opening nats! It was
    really hard to find details on how to open the NAT on my Modem and i found it out after ages of
    searching so basically anyone who wants me to find out how to open there NAT reply or PM me and i
    will try to find out how because mine was really complicated! It then will be easy for anyone in
    your position to find out....
  3. Opening Nat On Your Xbox - Upnp With Netgear
    for NETGEAR users with UPnP enabled (0)
    I think all of the NETGEAR Routers now come with UPnP Follow this tutorial and i will show you how
    to open your NAT. 1. Go to 192.168.1.1 (or 192.168.0.1 - or whatever they supplied you with) 2. Go
    down to maintenance and 'Attached Devices'. 3. My xbox is named '---' - most xboxes
    have that default name. 4. Make sure your xbox is located there and is in the IP you selected in
    your xbox wifi setup. 5. Now go down to 'Advanced' then 'UPnP' 6. If the
    'Turn UPnP On' is toggled - then uncheck it and apply. Then when it update....
  4. Xhtml Input Field Problem
    (1)
    Hi, i use XHTML Strict and CSS, making one site. Here's some CSS code : CODE .LoginFromField
    { margin : 9px 3px 0 3px; width : 120px; height : 18px; float : left; color :
    #666; background-image : url(./FormFieldDefaultBg.gif); background-repeat : repeat;
    font-family : Verdana, Helvetica, sans-serif; font-size : 12px; border : 1px solid #aaa;
    } XHTML code: CODE <?xml version="1.0" encoding="windows-1251"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "h....
  5. Window Shortcut
    Let's play with keyboard. (0)
    Do you use the mouse for all commands and functions ? You should know better. Studies indicates that
    productivity decrease when you shift between the keyboard and the mouse to input data. So learn the
    shortcuts,familiarise yourself with your keyboard, increase productivity, and show all those guys
    their right place. While Windows comes with a lot of default shortcuts which simplify tasks like
    searching and opening windows applications. Windows Shortcuts - Have you ever played arround with
    the windows key on your keyboard ? That's the small key between the Alt an....
  6. Opening Large Programs With Ms Word
    HAHA! (0)
    Step 1 --> Open up microsoft word if you have it. If you don't.... try another word
    processing program... or else your screwed... sorry. Step 2 --> Go to open. Step 3 -->
    Enable all files for opening. (Right underneath where you would type a file name) Step 4 -->
    Select something gigantic like google earth, etc... Step 5 --> Wait a minute or two... you
    have gigantic hunred thousand page documents! Well... nothing you can really read or understand
    but whatever.... (If you have autocad or rhino, or bryce, etc... you can actually reach t....
  7. Technology Identifies Invisible Intruders On Wireless Lans
    System is a window into an invisible world (0)
    What do you think of wireless. It's secure? , safey ? , or not !! When using wireless
    every day every where. The security issues still the bigger problems that many users faced today.
    What do think if a system could detected that some intruders were entered your network like the
    wired one. Is it good enough ? Now it's may be the time !! Take a look of this article
    may be you will know more. URL : http://www.computerworld.com.au/index.php/...62;fp;16;fpid;1 ....
  8. Remote Desktop Connection
    How to set up remote desktop connection on Window (7)
    Hi, Last term, I presented my presentation to my supervisor every day with Remote Desktop
    Connection. I did not need to bring my laptop from my hostel to campus, campus to hostel. It is very
    convenient for me. So, I would like to share my knowledge to you. It is also good when you are away
    from your computer, you can still access your computer from the distance. For example, if you were
    in Italy and studied there, you should not need to bring your computer, but you could manage your
    computer. It is very simple and very easy. I would like to explain with pictures. There....
  9. The Opening Guitar Bit To "you're Beautiful"
    What other song is it in? (3)
    I heard this song one the radio the other day, and I'd heard it ages ago before, but never
    noticed the opening bit /tongue.gif" style="vertical-align:middle" emoid=":P" border="0"
    alt="tongue.gif" /> But I'm sure it's from another song, I can't think what though
    /laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" /> Does anyone
    know? (If you're not sure how it goes, I'm sure the video's on an official (no illegal
    sites!) site somewhere /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt=....
  10. Php An Js Window.open Pages Trouble.
    I need a way to set hidden input values to the new window. (3)
    I have 2 main pages Page A(events_locked.php) and Page B(add_attendance.php). Both are php files.
    Page A takes a post var from another page(not Page B ) and then used to query for displaying records
    in a mysql datase. This variable has set as a session variable because there is 1 <script
    LANGUAGE="JavaScript"> window.name="main_index"; function openFormWindow() {
    OpenWindow=window.open("add_attendance.php", "newwin", "height=250,
    width=400,toolbar=no,scrollbars=no,menubar=no,location=no,resizable=no"); var x =
    getElementByName("form1"); x.target="newwin"; x.s....
  11. Window Xp Registry Tweaks
    (0)
    Window XP registry tweaks How to show password in Dialup window As you know Windows XP hides
    passwords in dialup popup window, to show password in Dialup window: 1- Click start menu > click on
    Run and type "regedit" to run Windows Registry Editor. 2- Go to following address: CODE
    HKEY_LOCAL_MACHINE-SYSTEM—CurrentControlSet- Modify Services--RasMan—Parameters 3- Create a new
    DWORD entry, name it as DisableSavePassword. Give it value of 1. How to display Windows Built in
    number on desktop To display Windows Built in number on desktop do following: 1- Click s....
  12. Opening Port
    (0)
    Hello! Can you please open UDP port 27015 on my hosting account? I need it, couse of "Live
    Server View" part of Psychostasts 3.....
  13. How Xhtml Is Different From Html?
    (2)
    Recently I went through some tutorials in w3schools.com about XHTML. I got the idea that XHTML is
    just the combination of XML and HTML. It is just some changes which has to be done to the
    traditional HTML pages to make it XHTML page. Now, my doubt is that is it that the search engines
    especially Google rank website page according to the HTML specifications they use in the page.
    Like, will a XHTML page have a more edge over the HTML page when it comes to search rankings?
    Please reply me. Thank you..! Topic title modified. ....
  14. Explorer.exe Problem When Opening Document
    (6)
    just recently, whenever i open like my docs or anything, you know its explorer.exe, whenever i right
    click in my docs, it opens a nother folder, like a seperate folder on a seperate screen, you know?
    it doesnt go into the folder, and its a strange folder i havnt seen, and then i get a report from
    windows saying they have closed explorer.exe because the file opened was not safe or something...
    and then later whenver i turn my comp on, it says my system crashed, and asks me if i want to
    restore it help? started like a week ago i posted in the right spot, right Changed ....
  15. Top Tips When Opening An (online) Business
    Remember (7)
    1). Always plan. you need to be sure about what you are doing, and how you are going to do it. -
    Make sure that it is legal - Check that people want what you are (selling) to them - Find out more
    about what you are doing or selling, become a novice expert in it, so you can answer any question
    thrown at you - MAKE SURE YOU HAVE THE TIME TO DO IT . Whilst it might sound fun to have an
    internet business on the sideline... when people start to get impatient and it is down-rated, you
    are wasting lots of money in profits. 2). Make sure you have, or can find the r....
  16. Window Media Player License.
    having trouble with it. (1)
    Hey friends i m having trouble with some window media audio formats. when i try to play them it says
    download media player security license. i tried to download but it says url not found. Plz can
    some body help me? and i don't think that microsoft has designed this for some purpose! It
    is useless.. i'll must say that it is just a way to tease you. what do u think that microsoft
    should remove this feature?....
  17. Window Crystal
    Upgrade Graphics, new out look like vista (1)
    Hi, i am using new update windows Crystal, that have amazing graphics, QUOTE This no-frills
    program lets you adjust the transparency of open windows, but don't expect anything
    awe-inspiring. Crystal XP's comprehensive interface is reminiscent of Windows and offers its
    configurations in English and Dutch. The program lets you set the transparency of active and
    inactive windows along with that of your taskbar. Hot keys can be assigned to adjust window
    transparencies without opening the program's interface. It sits in your system tray at start-up,
    and you c....
  18. How To Restore Show Desktop Icon
    in Window XP (3)
    How to restore Show Desktop icon in Windows XP Show Desktop is an icon in the quick lunch that
    lets you minimize all open windows quickly. If you delete Show Desktop icon casually, you cannot
    restore it as usual. To restore Show Desktop icon do following; Open Notepad and copy/paste
    following code: CODE [Shell] Command=2 IconFile=explorer.exe,3 [Taskbar]
    Command=ToggleDesktop And finally save above file as Show Desktop.scf in the following address:
    QUOTE C:\ Document and Settings \ Username \ Application Data \ Micr....
  19. Xhtml Strict Links Tip
    A problem might accure (5)
    If you try to put a link that has an & in your xHTML strict page, you need to change & to & in
    order for the page to be xHTML Strict.. eg.. BAD LINK: CODE
    http://jasamza.korisnik.com/forums/viewtopic.php?f=19&t=7&sid=6c2e9120dcff6e0b83698c4aa7be929a
    GOOD LINK: CODE
    http://jasamza.korisnik.com/forums/viewtopic.php?f=19&t=7&sid=6c2e9120dcff6e0b83698c4aa7
    be929a copy pasted &....
  20. Questions About Xml, Xhtml
    (3)
    Hi, I like to know briefly about XML , XHTML and can be they be in replacement of MYSQL/MYSQL for
    data storage?....
  21. No Google Talk For Linux?
    Is there anyway you can use gtalk in linux without opening your browse (6)
    I've been using linux (kubuntu and just installed sabayon) for the past month and am very happy
    with it but for the fact that I can't use gtalk with it. Gtalk is my favorite chat client and I
    don't like chatting using a browser. Does anyone know of a way to get gtalk to work in linux?....
  22. Windows Vista Gui Vs Window Xp Gui
    (17)
    Hi, We have been seeing Windows Vista Screenshots and from that we can take a look at the new GUI
    for Windows. Its called Aero. But i believe it looks more like Linux. Dont you think so. Now the
    Windows GUI is no longer unique. The are back with same GUI that other Operating Systems Already
    have and Also just take a look at the icons. They are not good at all. Any information about Windows
    GUI or you views on it. Please Reply Thank You....
  23. Maintaining Browser Size On Your Computer
    browser window size defined by you (4)
    I have the darnest time while navigating the internet these days. Has this happen to you? You visit
    a site for your research and enter a site that causes multiple browsers to open (but in different
    size). But your prefered browser size is not full but a certain size (probably you made it such wide
    and sich high). Or, you test your website for different resolutions. But the last browser window you
    closed caused your new browsers to open in different sizes... ack! My computer screens are
    either in 1280x1024 or widescreen mode. And thus i want my browser to be in fixed....
  24. Auto-opening Toilet-seat
    (32)
    You know, those trash cans which have some kind of button at their bottom. So you can press it with
    your foot, and its top opens itself. By this you can ditch your trash without bending and opening
    trashcan. Anyway, lets make this system to toilet-seat (closet?) So for men, they can just press
    the bottom button with his foot while urinating in stand-up. This will save us time, and you never
    be worried about forgeting the top open. /smile.gif" style="vertical-align:middle" emoid=":)"
    border="0" alt="smile.gif" />....
  25. Javascript Close Window
    Javascript close window (12)
    Hi does anyone have a code to close the browser window. This code needs to be used to close an
    actual full sized window, not a pop-up window.....
  26. How To Reference Parent Browser Window From.....
    (2)
    i have a custom button on the local browser toolbar which points to a local html application (HTA).
    the browser launches the HTA when the custom button is clicked. i have to reference the parent
    browser window from the child HTA window. an instruction in the local HTA window.opener sets or
    retrieves a reference to the window (the browser) that created the current window (the HTA).
    however, window.opener is returning null. the HTA is run under the mshta.exe process. how do i
    reference the browser from the HTA or javascript? i have winxp sp2 with ie6.0 kvarnerexpress....
  27. Window Media Player Or Winamp?
    Which one you like? (34)
    Window Media Player or Winamp? Which one do you like? Reason. I like Both though I use Window Media
    Player to play movie instead of using it to listen to music. Window Media Player I use it when that
    I watch anime then having a codec attach to it. It is easier to watch it through Window Media
    Player. Winamp, I used it to play songs. It is easy to use and simple. You can have a movie on
    Winamp too but it is a bit hard (for me) to use through Winamp and play the movie. When you play
    songs you have adjust a sound too, or tune it.....
  28. Photoshop Registration
    concerning the pop-up window (6)
    hey, when you start installing photoshop, does the registration window pop up at the beginning ? or
    it doesn't come out until your 30 day trial is over? because i've reformatted my comp like 3
    times and i have ps on te cd saved but whenever i try to install it it never asks me to register
    it... also which is better? PHOTOSHOP cs OR PHOTOSHOP the newer version? and will the brushes for
    ps8 work on the newer one? thank you!....
  29. [help] Java Script: Window.open
    Works with Firefox, not IE (8)
    CODE <HEAD> var popUpWin=0; function popUpWindow(URLStr) {
     if(popUpWin)  {    if(!popUpWin.closed) popUpWin.close();  }
     popUpWin = open(URLStr, 'GunBound Tactics: Screenshots',
    'width=820,height=550,menubar=no,resizable=yes,scrollbars=yes,toolbar=no,top=90,left=90')
    ;; } </HEAD> <BODY> <a
    href="javascript:popUpWindow('/f11/clipped.php');"><b>Clips&
    #60;/b></a> This is a script for opening a new window. It works ....
  30. Did You Face Problem Opening Pdf With Firefox?
    (14)
    Hello, I have a question to ask since the 1st day of my download of firefox ... Whenever i open a
    pdf file online using firefox, the firefox is get not responding and my comp got hanged ... i have
    to manually end the firefox program via windows task manager .. I tried to wait the pdf to load, but
    it seems that it takes forever .. so im guessing it's the trail version's bug .. but after a
    few updates, I still have the problems with my firefox ... Is this my computer's problem or
    firefox problem ? If it's a firefox bug, it's impossible that no1 report ....

    1. Looking for opening, hyperlink, window, xhtml, 1, 0, strict

Searching Video's for opening, hyperlink, window, xhtml, 1, 0, strict
Similar
Surf
Internet
Without
Opening It.
Useful For
School -
How-to!
Opening Nat
Requests
Opening Nat
On Your Xbox
- Upnp With
Netgear -
for NETGEAR
users with
UPnP enabled
Xhtml Input
Field
Problem
Window
Shortcut -
Let's
play with
keyboard.
Opening
Large
Programs
With Ms Word
- HAHA!
Technology
Identifies
Invisible
Intruders On
Wireless
Lans -
System is a
window into
an invisible
world
Remote
Desktop
Connection -
How to set
up remote
desktop
connection
on Window
The Opening
Guitar Bit
To
"you
9;re
Beautiful&qu
ot; - What
other song
is it in?
Php An Js
Window.open
Pages
Trouble. - I
need a way
to set
hidden input
values to
the new
window.
Window Xp
Registry
Tweaks
Opening Port
How Xhtml Is
Different
From Html?
Explorer.exe
Problem When
Opening
Document
Top Tips
When Opening
An (online)
Business -
Remember
Window Media
Player
License. -
having
trouble with
it.
Window
Crystal -
Upgrade
Graphics,
new out look
like vista
How To
Restore Show
Desktop Icon
- in Window
XP
Xhtml Strict
Links Tip -
A problem
might accure
Questions
About Xml,
Xhtml
No Google
Talk For
Linux? - Is
there anyway
you can use
gtalk in
linux
without
opening your
browse
Windows
Vista Gui Vs
Window Xp
Gui
Maintaining
Browser Size
On Your
Computer -
browser
window size
defined by
you
Auto-opening
Toilet-seat
Javascript
Close Window
- Javascript
close window
How To
Reference
Parent
Browser
Window
From.....
Window Media
Player Or
Winamp? -
Which one
you like?
Photoshop
Registration
- concerning
the pop-up
window
[help] Java
Script:
Window.open
- Works with
Firefox, not
IE
Did You Face
Problem
Opening Pdf
With
Firefox?
advertisement



Opening Hyperlink In New Window Using Xhtml 1.0 Strict



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE