$('a.video', toolbar).click(function() { _this.save_bookmark(); _this.hide_menu(); $(this).xn_menu($('.video', menu), 0, 5000); setTimeout(function() { $('.video input.url', menu).focus().select(); }, 100); }); $('.video input.insert', menu).click(function() { var url = $('.video input.url', menu).val(); var width = $('.video input.w', menu).val(); var height = $('.video input.h', menu).val(); _this.add_video(url, width, height); return true; }); $('.video input.close', menu).click(function() { _this.hide_menu(); _this.load_bookmark(true); return true; });
this.add_video = function(url, width, height) { width = intval(width); height = intval(height); 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>"; _this.paste(s); $('div.video', _this.menu).hide(); };
以上是两个变量 width 和 height 全部被变量转换成整型变量 了,我现在两个变量输出的都是0,文字和字母输入后都不显示应该是被转换的缘故,我想请朋友帮我改改这段代码,要求输出的两个变量 width 和 height
width 是URL形式的 height可以是文字 字幕 和数字形式(总之是去掉转型这块,代码我删除了转型的那两句但是依然还是输出的数值是0不知道怎么改了)
回复讨论(解决方案)
有没有人在啊?????????在线等
也没个人出来救救人
fasdfasfasdf
你这个是js,不是php
而js转整形的方法是parseInt 而不是intval, intval是php的方法
所以你的代码是错的。
var width = $('.video input.w', menu).val();
var height = $('.video input.h', menu).val();
这两个变量先打印出来看看是什么,估计这里就已经是0了,你获取width与height的方法不对。
jquery获取width与height应该这样写。
var width=$("#div").width();
var height=$("#div").height();
jquery获取width与height应该这样写。
var width=$("#div").width();
var height=$("#div").height();
谢谢版主大人已经被你解决了哈哈哈

TooptimizePHPcodeforreducedmemoryusageandexecutiontime,followthesesteps:1)Usereferencesinsteadofcopyinglargedatastructurestoreducememoryconsumption.2)LeveragePHP'sbuilt-infunctionslikearray_mapforfasterexecution.3)Implementcachingmechanisms,suchasAPC

PHPisusedforsendingemailsduetoitsintegrationwithservermailservicesandexternalSMTPproviders,automatingnotificationsandmarketingcampaigns.1)SetupyourPHPenvironmentwithawebserverandPHP,ensuringthemailfunctionisenabled.2)UseabasicscriptwithPHP'smailfunct

The best way to send emails is to use the PHPMailer library. 1) Using the mail() function is simple but unreliable, which may cause emails to enter spam or cannot be delivered. 2) PHPMailer provides better control and reliability, and supports HTML mail, attachments and SMTP authentication. 3) Make sure SMTP settings are configured correctly and encryption (such as STARTTLS or SSL/TLS) is used to enhance security. 4) For large amounts of emails, consider using a mail queue system to optimize performance.

CustomheadersandadvancedfeaturesinPHPemailenhancefunctionalityandreliability.1)Customheadersaddmetadatafortrackingandcategorization.2)HTMLemailsallowformattingandinteractivity.3)AttachmentscanbesentusinglibrarieslikePHPMailer.4)SMTPauthenticationimpr

Sending mail using PHP and SMTP can be achieved through the PHPMailer library. 1) Install and configure PHPMailer, 2) Set SMTP server details, 3) Define the email content, 4) Send emails and handle errors. Use this method to ensure the reliability and security of emails.

ThebestapproachforsendingemailsinPHPisusingthePHPMailerlibraryduetoitsreliability,featurerichness,andeaseofuse.PHPMailersupportsSMTP,providesdetailederrorhandling,allowssendingHTMLandplaintextemails,supportsattachments,andenhancessecurity.Foroptimalu

The reason for using Dependency Injection (DI) is that it promotes loose coupling, testability, and maintainability of the code. 1) Use constructor to inject dependencies, 2) Avoid using service locators, 3) Use dependency injection containers to manage dependencies, 4) Improve testability through injecting dependencies, 5) Avoid over-injection dependencies, 6) Consider the impact of DI on performance.

PHPperformancetuningiscrucialbecauseitenhancesspeedandefficiency,whicharevitalforwebapplications.1)CachingwithAPCureducesdatabaseloadandimprovesresponsetimes.2)Optimizingdatabasequeriesbyselectingnecessarycolumnsandusingindexingspeedsupdataretrieval.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
