Home  >  Article  >  Backend Development  >  php代码关于变量转义的有关问题

php代码关于变量转义的有关问题

WBOY
WBOYOriginal
2016-06-13 12:26:021105browse

php代码关于变量转义的问题

$('a.video', toolbar).click(function() {<br />			_this.save_bookmark();<br />			_this.hide_menu();<br />			$(this).xn_menu($('.video', menu), 0, 5000);<br />			setTimeout(function() {<br />				$('.video input.url', menu).focus().select();<br />			}, 100);<br />		});<br />		$('.video input.insert', menu).click(function() {<br />			var url = $('.video input.url', menu).val();<br />			var width = $('.video input.w', menu).val();<br />			var height = $('.video input.h', menu).val();<br />			_this.add_video(url, width, height);<br />			return true;<br />		});<br />		$('.video input.close', menu).click(function() {<br />			_this.hide_menu();<br />			_this.load_bookmark(true);<br />			return true;<br />		});


this.add_video = function(url, width, height) {<br />		width = intval(width);<br />		height = intval(height);<br />		var s = "<br><br><center><script type=\"text/javascript\" src=\"jwplayer/jwplayer.js\"></script><div id=\"mediaplayer\"></div> <script type=\"text/javascript\">jwplayer('mediaplayer').setup({'flashplayer': 'jwplayer/jwplayer.flash.swf','image': 'http://7vzuer.com1.z0.glb.clouddn.com/t013d040a81b623566f.jpg', 'id': 'playerID', 'width': '100%', 'aspectratio':'10:6', 'title':'"+height+"', 'tracks':'"+width+"', 'file': '"+url+"' });</script><br><br></center>";<br />		_this.paste(s);<br />		<br />		$('div.video', _this.menu).hide();<br />	};

以上是两个变量 width 和 height 全部被变量转换成整型变量 了,我现在两个变量输出的都是0,文字和字母输入后都不显示应该是被转换的缘故,我想请朋友帮我改改这段代码,要求输出的两个变量 width 和 height 
width 是URL形式的 height可以是文字 字幕 和数字形式(总之是去掉转型这块,代码我删除了转型的那两句但是依然还是输出的数值是0不知道怎么改了)
------解决思路----------------------
jquery获取width与height应该这样写。
var width=$("#div").width();
var height=$("#div").height();

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn