问题是这样的:前几天我在网上下了一个插件jrecorder,这是一个不需要任何flash编程技术就可以实现在线录音的jquery插件,但问题出现了,我在http://www.sajithmr.me/jrecorder/exam... 上下了插件,也按照提示把插件装在本地服务器上,但是老是出错:Uncaught TypeError: Object #
//function call to start a recording $.jRecorder.record = function(max_time){ //change z-index to make it top $( '#' + jRecorderSettings['recorderlayout_id'] ).css('z-index', 1000); getFlashMovie(jRecorderSettings['recorder_name']).jStartRecording(max_time); }
本地测试时使用的代码:
<meta name="author" content="Sajith Amma"> <script src="../js/jquery.min.js"> </script> <script src="../js/jRecorder-1.0-old.js"> </script> <title>jRecorder Example</title> <div id="locationforrecorder" style="border:1px solid grey"> </div> <script> $.jRecorder( { host : 'http://localhost/nahan/recorder/acceptfile.php?filename=hello.wav' , callback_started_recording: function(){callback_started(); }, callback_stopped_recording: function(){callback_stopped(); }, callback_activityLevel: function(level){callback_activityLevel(level); }, callback_activityTime: function(time){callback_activityTime(time); }, callback_finished_sending: function(time){ callback_finished_sending() }, swf_path : 'jRecorder.swf', } , $('#locationforrecorder') ); </script> <div style="background-color: #eeeeee;border:1px solid #cccccc"> Time: <span id="time">00:00</span> </div> <div> Level: <span id="level"></span> </div> <div id="levelbase" style="width:200px;height:20px;background-color:#ffff00"> <div id="levelbar" style="height:19px; width:2px;background-color:red"></div> </div> <div> Status: <span id="status"> </span> </div> <div> <input type="button" id="record" value="Record" style="color:red"> <input type="button" id="stop" value="Stop"> </div> <script type="text/javascript"> $('#record').click(function(){ $.jRecorder.record(30); }) $('#stop').click(function(){ $.jRecorder.stop(); }) function callback_finished() { $('#status').html('Recording is finished'); } function callback_started() { $('#status').html('Recording is started'); } function callback_error(code) { $('#status').html('Error, code:' + code); } function callback_stopped() { $('#status').html('Stop request is accepted'); } function callback_finished_recording() { $('#status').html('Recording event is finished'); } function callback_finished_sending() { $('#status').html('File has been sent to server mentioned as host parameter'); } function callback_activityLevel(level) { $('#level').html(level); if(level == -1) { $('#levelbar').css("width", "2px"); } else { $('#levelbar').css("width", (level * 2)+ "px"); } } function callback_activityTime(time) { //$('.flrecorder').css("width", "1px"); //$('.flrecorder').css("height", "1px"); $('#time').html(time); } </script>
我查看了网上那个示例的源代码,发现和我本地上的代码没有区别,所以真的很郁闷,到底哪里出错了?
回复内容:
问题是这样的:前几天我在网上下了一个插件jrecorder,这是一个不需要任何flash编程技术就可以实现在线录音的jquery插件,但问题出现了,我在http://www.sajithmr.me/jrecorder/exam... 上下了插件,也按照提示把插件装在本地服务器上,但是老是出错:Uncaught TypeError: Object #
//function call to start a recording $.jRecorder.record = function(max_time){ //change z-index to make it top $( '#' + jRecorderSettings['recorderlayout_id'] ).css('z-index', 1000); getFlashMovie(jRecorderSettings['recorder_name']).jStartRecording(max_time); }
本地测试时使用的代码:
<meta name="author" content="Sajith Amma"> <script src="../js/jquery.min.js"> </script> <script src="../js/jRecorder-1.0-old.js"> </script> <title>jRecorder Example</title> <div id="locationforrecorder" style="border:1px solid grey"> </div> <script> $.jRecorder( { host : 'http://localhost/nahan/recorder/acceptfile.php?filename=hello.wav' , callback_started_recording: function(){callback_started(); }, callback_stopped_recording: function(){callback_stopped(); }, callback_activityLevel: function(level){callback_activityLevel(level); }, callback_activityTime: function(time){callback_activityTime(time); }, callback_finished_sending: function(time){ callback_finished_sending() }, swf_path : 'jRecorder.swf', } , $('#locationforrecorder') ); </script> <div style="background-color: #eeeeee;border:1px solid #cccccc"> Time: <span id="time">00:00</span> </div> <div> Level: <span id="level"></span> </div> <div id="levelbase" style="width:200px;height:20px;background-color:#ffff00"> <div id="levelbar" style="height:19px; width:2px;background-color:red"></div> </div> <div> Status: <span id="status"> </span> </div> <div> <input type="button" id="record" value="Record" style="color:red"> <input type="button" id="stop" value="Stop"> </div> <script type="text/javascript"> $('#record').click(function(){ $.jRecorder.record(30); }) $('#stop').click(function(){ $.jRecorder.stop(); }) function callback_finished() { $('#status').html('Recording is finished'); } function callback_started() { $('#status').html('Recording is started'); } function callback_error(code) { $('#status').html('Error, code:' + code); } function callback_stopped() { $('#status').html('Stop request is accepted'); } function callback_finished_recording() { $('#status').html('Recording event is finished'); } function callback_finished_sending() { $('#status').html('File has been sent to server mentioned as host parameter'); } function callback_activityLevel(level) { $('#level').html(level); if(level == -1) { $('#levelbar').css("width", "2px"); } else { $('#levelbar').css("width", (level * 2)+ "px"); } } function callback_activityTime(time) { //$('.flrecorder').css("width", "1px"); //$('.flrecorder').css("height", "1px"); $('#time').html(time); } </script>
我查看了网上那个示例的源代码,发现和我本地上的代码没有区别,所以真的很郁闷,到底哪里出错了?
把所有JS代码放到$(function() { ~~~~~~~~放置jRecorder代码~~~~~~~~~~~ })
解决了没有?

PHP用于构建动态网站,其核心功能包括:1.生成动态内容,通过与数据库对接实时生成网页;2.处理用户交互和表单提交,验证输入并响应操作;3.管理会话和用户认证,提供个性化体验;4.优化性能和遵循最佳实践,提升网站效率和安全性。

PHP在数据库操作和服务器端逻辑处理中使用MySQLi和PDO扩展进行数据库交互,并通过会话管理等功能处理服务器端逻辑。1)使用MySQLi或PDO连接数据库,执行SQL查询。2)通过会话管理等功能处理HTTP请求和用户状态。3)使用事务确保数据库操作的原子性。4)防止SQL注入,使用异常处理和关闭连接来调试。5)通过索引和缓存优化性能,编写可读性高的代码并进行错误处理。

在PHP中使用预处理语句和PDO可以有效防范SQL注入攻击。1)使用PDO连接数据库并设置错误模式。2)通过prepare方法创建预处理语句,使用占位符和execute方法传递数据。3)处理查询结果并确保代码的安全性和性能。

PHP和Python各有优劣,选择取决于项目需求和个人偏好。1.PHP适合快速开发和维护大型Web应用。2.Python在数据科学和机器学习领域占据主导地位。

PHP在电子商务、内容管理系统和API开发中广泛应用。1)电子商务:用于购物车功能和支付处理。2)内容管理系统:用于动态内容生成和用户管理。3)API开发:用于RESTfulAPI开发和API安全性。通过性能优化和最佳实践,PHP应用的效率和可维护性得以提升。

PHP可以轻松创建互动网页内容。1)通过嵌入HTML动态生成内容,根据用户输入或数据库数据实时展示。2)处理表单提交并生成动态输出,确保使用htmlspecialchars防XSS。3)结合MySQL创建用户注册系统,使用password_hash和预处理语句增强安全性。掌握这些技巧将提升Web开发效率。

PHP和Python各有优势,选择依据项目需求。1.PHP适合web开发,尤其快速开发和维护网站。2.Python适用于数据科学、机器学习和人工智能,语法简洁,适合初学者。

PHP仍然具有活力,其在现代编程领域中依然占据重要地位。1)PHP的简单易学和强大社区支持使其在Web开发中广泛应用;2)其灵活性和稳定性使其在处理Web表单、数据库操作和文件处理等方面表现出色;3)PHP不断进化和优化,适用于初学者和经验丰富的开发者。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

SublimeText3 Linux新版
SublimeText3 Linux最新版

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中