English 中文(简体)
环形参数
原标题:Passing style parameters in query string
  • 时间:2012-05-05 07:27:43
  •  标签:
  • html

I have a simple html page with a div element in it. The innerHTML property of the div is set through query String. In query string I pass html strings,i.e.

<p style= font-size:20px;color:green; > Sun rises in the east </p> etc...

我获得了适当的产出。

然而,如果我以属性的风格通过彩色代码,那么我就没有显示任何内容。

谁能帮助我这样做?

最佳回答

如果含有<代码>#的颜色代码,则此后将处理碎片识别。 为避免出现这种情况,您须对参数价值(替换<条码>#,<条码>%23)。 a 与其他具有特别意义的特性相同(@&%=?#...)。

最后,您也希望:

PageUrl?Content=%3Cp+style%3D%27color%3A%23009900%27%3EContent%3C%2Fp%3E
问题回答

既然你已经向我们展示了任何法典,我将猜测......

在URI,#,表示碎片识别标志的开始(作为?,表示查询线的开始。 你的颜色被打断,并开始进行碎片识别。 你们需要制定在URLs中具有特别意义的特性。 (#,%23)。


确保你在服务器上安放通过超文本和CSS。 很容易以其他方式暴露出突发事件。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签