...

View Full Version : / disapears on client



BubikolRamios
11-15-2010, 12:43 AM
I output the following text to client:


"<a href='xxx'><img class='user_img' alt = '' src='xxx' /></a>"


When I look on client the red part(including space before that) miracuasly disapears. Why is that ?



<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

Chris Hick
11-15-2010, 12:58 AM
Nevermind.. I'm going blindXD

DrDOS
11-15-2010, 01:08 AM
If you're using javascript to write tags you have to escape the forward slashes with back slashes. \/

BubikolRamios
11-15-2010, 05:59 AM
If you're using javascript to write tags you have to escape the forward slashes with back slashes. \/

yeah, tryed that, I'm not escaping </a>, and it comes out OK anyway.

DrDOS
11-15-2010, 02:06 PM
In that case then, it's not needed so the browser strips it. You already have an 'a' closing tag. The slash at the end of the opening tag is only needed for single tags like img or br, and only for certain doctypes.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum