我使用Codelginiter PHP MVC框架来开发一个Web应用程序,我试图使用form_open()而不是<form></form>,我想要做的是添加class="navbar-form navbar-left" role="search"它,似乎它不起作用.
这是制作表单的代码
<?php
echo
form_open('social_controller/search_me');
?>
Run Code Online (Sandbox Code Playgroud) 这是我的代码,我是初学者使用swift而我的代码不起作用,应用程序应该取'ageInput'textField的值并将其乘以7然后在resultLabel中显示结果,我总是得到错误:
无法将类型为'int'的值分配给'String?'类型的值
class ViewController: UIViewController {
@IBOutlet weak var resultLabel: UILabel!
@IBOutlet weak var ageInput: UITextField!
@IBAction func findAge(sender: AnyObject) {
var catAge = ageInput.text.toInt() ?? 0
catAge = catAge * 7 ?? 0
resultLabel.text = catAge
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
Run Code Online (Sandbox Code Playgroud)
我哪里做错了?
我试图打破一个长短语,取决于我的摩天大楼横幅宽度大小,不能超过三个字,我搜索互联网,发现一个脚本,通过设置短语的字符来打破文本,这是它.
<?
header("Content-type: image/png");
$string = $_GET['text']. ' Click Here';
$im = imagecreatefrompng("../../images/skyscrapper.png");
$orange = imagecolorallocate($im, 0, 0, 0);
$px = (imagesx($im) - 3.8 * strlen($string)) / 2;
$font = 'verdana.ttf';
// Break it up into pieces 10 characters long
$lines = explode('|', wordwrap($string, 10, '|'));
// Starting Y position
$y = 450;
// Loop through the lines and place them on the image
foreach ($lines as $line)
{
imagestring($im,3, $px, $y, $string, $orange);
// Increment Y so the next …Run Code Online (Sandbox Code Playgroud) 我试图通过CSS设计一个页面,问题是当我试图在浏览器上显示我的页面时Google Chrome,它不起作用,它显示我破坏的设计页面,设计只适用于chrome,我使用代码前缀使我的css3代码匹配所有浏览器.
这是我的代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>anaawez</title>
</head>
<style>
html {
height: 100%;
}
body {
margin: 0;
padding: 0;
height: 97%;
background-image: url(bg.jpg);
background-repeat-x: repeat;
background-repeat-y: no-repeat;
background-attachment: initial;
background-position-x: initial;
background-position-y: initial; /*background-origin*/
-webkit-background-origin: initial;
-moz-background-origin: initial;
background-origin: initial; /*background-clip*/
-webkit-background-clip: initial;
background-color: #718693;
}
#wrapper {
background: white;
border: 1px solid #000;
margin: auto;
margin-top: 10px;
font: 1.5em arial, verdana, sans-serif;
width: …Run Code Online (Sandbox Code Playgroud) 我试图通过使用PhoneGap的插件调用显示在Android模拟器设备的通知味精StatusBarNotification,LINK,我跟着instrucations这个词,但是当我部署我的应用程序没有任何显示在状态栏,
令我困惑的是我不知道在哪里放置我的非语法语法调用,它是:
window.plugins.statusBarNotification.notify("Put your title here", "Put your message here");
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能解决这个问题?
我正在尝试提醒JSON元素使用JQuery,这是我的代码:
data.js JSON数据
[
{
"name": "bader",
"major": "medicine",
"id": "334453"
}
]
Run Code Online (Sandbox Code Playgroud)
Jquery代码
$(document).ready(function() {
$.getJSON("data.js", function(json) {
alert("JSON Data: " + json.name);
});
});
Run Code Online (Sandbox Code Playgroud)
我试图检查元素我在我的consol上有这个错误
XMLHttpRequest cannot load file:///data.js. Origin null is not allowed by Access-Control-Allow-Origin.
Run Code Online (Sandbox Code Playgroud)
我仍然很新的处理JSON和JQUERY,我不知道我哪里错在这里,如果有人可以帮助