任何人都可以告诉我如果我们只有URL或嵌入代码,我们如何展示或嵌入YouTube视频?
如何通过AngularJS将JSON数据发布到Web服务这里是代码片段
.controller('MessagePostCtrl', function($scope, $http) {
$scope.postMessage = function() {
var msg = document.getElementById('message').value;
var msgdata = {
message : msg
};
var res = $http.post('http://<domain-name>/messenger/api/posts/savePost',msgdata);
res.success(function(data, status, headers, config) {
console.log(data);
});
}
})
Run Code Online (Sandbox Code Playgroud)
选项http:/// messenger/api/posts/savePost
ionic.bundle.js:16185(匿名函数)ionic.bundle.js:16185 sendReq ionic.bundle.js:15979 serverRequest ionic.bundle.js:15712 wrappedCallback ionic. bundle.js:19197 wrappedCallback ionic.bundle.js:19197(匿名函数)ionic.bundle.js:19283范围.$ eval ionic.bundle.js:20326范围.$ digest ionic.bundle.js:20138范围.$ apply ionic.bundle.js:20430(匿名函数)ionic.bundle.js:43025(匿名函数)ionic.bundle.js:10478 forEach ionic.bundle.js:7950 eventHandler ionic.bundle.js:10477 triggerMouseEvent ionic.bundle. js:2648 tapClick ionic.bundle.js:2637 tapMouseUp ionic.bundle.js:2707XMLHttpRequest无法加载http:/// messenger/api/posts/savePost.无效的HTTP状态代码404
但是当我从$ http.post方法中删除msgdata时,一切正常.任何人都可以告诉我问题在哪里,或者指导我如何将JSON数据发送到Web服务
谢谢您的帮助
**Edited:
The Issue was with the CORS, Im using codeigniter REST Controller …Run Code Online (Sandbox Code Playgroud) 我的ajax应用程序在Firefox中运行良好,但在IE8中运行不正常.具体来说,ajax功能不起作用.
这是我正在使用的代码:
function createXMLHttpRequest()
{
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{
// code for IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
Run Code Online (Sandbox Code Playgroud)
这是错误:
Object doesn't support this property or method
ajax.js
Code:0
Line : 6
Char : 5
Run Code Online (Sandbox Code Playgroud)
它在Firefox中完美运行.
我的代码有什么问题?
当我尝试登录应用程序时,我正试图将我的代码从本地移动到服务器

Here is my AppController
class AppController extends Controller{
/* Determines what logged-in users access to */
var $components = array('Auth','Session');
public function isAuthorized($user){
return true;
}
public function beforeFilter(){
$userdetails = array();
$this->Auth->autoRedirect = false;
$this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'matches', 'action' => 'index');
$this->Auth->authorize = 'controller';
$this->Auth->authError= 'You need permissions to access this page';
$this->Auth->allow('users');
$this->set('Auth',$this->Auth);
$userdetails = $this->Auth->user();
$this->set('myUser', $userdetails['username']);
$this->set('myRole', $userdetails['user_role_id']);
$this->set('pStatus', $userdetails['password_status']);
}
}
Here is my Login …Run Code Online (Sandbox Code Playgroud) 谁能告诉我,问题出在哪里?
这是我的控制器
class Support extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('support_model');
$urlarray = array("index","delete");
if(!in_array($this->uri->segment(2),$urlarray)){
$this->viewticket($this->uri->segment(2));
}
}
public function viewticket($id){
if(!empty($id)){
$this->load->view('templates/logged_header');
$this->load->view('support/view');
$this->load->view('templates/footer');
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的routes.php
$route['default_controller'] = "welcome";
$route['benefits'] = 'welcome/benefits';
$route['faqs'] = 'welcome/faqs';
$route['distributors'] = 'welcome/distributors';
$route['contact'] = 'welcome/contact';
$route['purchase'] = 'welcome/purchase';
//login routes
$route['login'] = 'login/index';
$route['logout'] = 'login/logout';
$route['404_override'] = '';
Run Code Online (Sandbox Code Playgroud)
localhost/ciproj/support/hello-world给我404 Page Not Found错误
如果我使用exit;后$this->load->view('templates/footer');,页面显示空白页面.
我在支持相关的路线中没有任何东西,而且其他方法都有效吗?我在路线中缺少什么?
谢谢您的帮助.
我正在寻找网络托管空间,并且知道PHP版本是4.3和MySQL版本4.1
但我在MySQL 5.x版和PHP版5.x版中开发了我的应用程序
任何人都可以给我版本的差异吗?
我现在无法访问的是什么?
谢谢...
有人能告诉我为什么chrome会获得2个不同的值?
我这样用过
$rand = rand(1,10);
Run Code Online (Sandbox Code Playgroud)
我在表单中使用相同的值作为隐藏值
<input type='hidden' name='key' id='key' value=<?php echo $rand ?> />
Run Code Online (Sandbox Code Playgroud)
当我回显$ rand并看到视图源时,我发现这两个值是不同的
这种情况只发生在铬?
请试试这个例子
echo $rand = rand(9999,99999);
mysql_query("update <table> set enc_code='$rand'");
Run Code Online (Sandbox Code Playgroud)
告诉我你是否得到相同的回声值更新到表?
谢谢
我正在尝试在服务器购买的godaddy共享服务器上设置我的cakephp工作
当我去我的网站http://xyz.com/cake/ 我收到404错误
The requested URL /xyz/cake/app/webroot/ was not found on this server.
Run Code Online (Sandbox Code Playgroud)
anyhelp plz ??
谢谢,
萨蒂什
php ×4
cakephp-2.0 ×2
ajax ×1
angularjs ×1
codeigniter ×1
html ×1
migration ×1
php4 ×1
video ×1
youtube ×1
youtube-api ×1