我想在ul-list中添加一个类(class ="bbox"),但前提是不存在类.这就是我到目前为止所拥有的.如果ul-tag中存在类,如何检查jquery?
$("ul").addClass("bbox");
Run Code Online (Sandbox Code Playgroud) 我试图通过提供JSON格式数据的Web服务请求天气.我的PHP请求代码没有成功,是:
$url="http://www.worldweatheronline.com/feed/weather.ashx?q=schruns,austria&format=json&num_of_days=5&key=8f2d1ea151085304102710";
$json = file_get_contents($url);
$data = json_decode($json, TRUE);
echo $data[0]->weather->weatherIconUrl[0]->value;
Run Code Online (Sandbox Code Playgroud)
这是返回的一些数据.为简洁起见,部分细节已被截断,但保留了对象完整性:
{ "data":
{ "current_condition":
[ { "cloudcover": "31",
... } ],
"request":
[ { "query": "Schruns, Austria",
"type": "City" } ],
"weather":
[ { "date": "2010-10-27",
"precipMM": "0.0",
"tempMaxC": "3",
"tempMaxF": "38",
"tempMinC": "-13",
"tempMinF": "9",
"weatherCode": "113",
"weatherDesc": [ {"value": "Sunny" } ],
"weatherIconUrl": [ {"value": "http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0001_sunny.png" } ],
"winddir16Point": "N",
"winddirDegree": "356",
"winddirection": "N",
"windspeedKmph": "5",
"windspeedMiles": "3" },
{ "date": "2010-10-28",
... }, …Run Code Online (Sandbox Code Playgroud) 有谁知道如何根据时间戳显示flot中的日期
<script id="source" language="javascript" type="text/javascript">
$(function () {
var d1 = [
[1262818800,100],[1262732400,100],[1262646000,100],[1262559600,100],[1262473200,100],[1262386800,100],[1262300400,100],[1262214000,100],[1262127600,100],[1262041200,100],[1261954800,100],[1261868400,100],[1261782000,100],[1261695600,100],[1261609200,100],[1261522800,95],[1261436400,110],[1261350000,110],[1261263600,110],[1261177200,100];
var d2 = [
[1262818800,23],[1262732400,23],[1262646000,23],[1262559600,23],[1262473200,23],[1262386800,23],[1262300400,25],[1262214000,25],[1262127600,25],[1262041200,25],[1261954800,25],[1261868400,25],[1261782000,25],[1261695600,25],[1261609200,25],[1261522800,25],[1261436400,10],[1261350000,10],[1261263600,10],[1261177200,10]
$.plot($("#placeholder"), [{data:d1,lines:{show: true},label:"Mountain"},{data:d2,lines:{show: true},label:"Valley"}],{yaxis: {label:"cm"}},
{xaxis: {mode:"time"
}}
);
});
</script>
Run Code Online (Sandbox Code Playgroud) 我需要在我的数据库中存储名为'msg'的json字符串中的变量,但是我无法用$ msg = $ _POST ['msg']来捕获它.我该如何正确捕捉它?
此外,我想在网页上直接回复$ msg的内容.
<div id="addCommentContainer">
<form id="addCommentForm" action="">
<textarea name="msg" id="msg" cols="82" title="Your comment" rows="2">Your comment...</textarea>
<br />
<input type="text" name="author" title="name" value="<?php echo $_SESSION['username']; ?>" id="author" />
<br />
<div id="personal">
<input type="text" name="city" id="city" title="city (optional)" value="" />
<br />
<input type="text" name="email" id="email" title="e-mail (optional)" value="" />
<br />
<input type="text" name="url" id="url" title="website (optional)" value="" />
<input type="hidden" id="cam_id" class="hd" name="cam_id" value="<?php echo $cam_id ?>" />
</div>
<input type="submit" id="submit" …Run Code Online (Sandbox Code Playgroud) 我将我的网站从/ v1/etc ...目录移动到/ v2/etc ...目录,并希望在htaccess中进行永久重定向.有人能帮我吗?
我想将下面的ajax函数的响应显示给dom中的div(更新div).如何在不使用重插件的情况下完成此操作.
url: 'http://dowmian.com/xs1/getcam.php',
type: 'GET',
data: {id: <?php echo $cam_id; ?>},
success: function(responseText){
},
error: function(responseText){
}
Run Code Online (Sandbox Code Playgroud) 我想舍入(0位小数)flot图的x轴上的值.x-axix显示周数.有谁知道这是怎么做到的吗?
一旦访问者移动地图,我就会尝试通过 Json 添加标记。由于某种原因, moveend 没有被捕获和/或 onClickCallback 函数没有被触发。我哪里出错了。
google.maps.event.addListener(map, "moveend", function() {
var bounds = this.getBounds();
onClickCallback(map);
});
function onClickCallback(map) {
var bounds = map.getBounds();
// clearOverlays();
$.getJSON( 'http://skiweather.eu/gmap4/markers/index.php', {
swLat: bounds.getSouthWest().lat(), swLon: bounds.getSouthWest().lng(),
neLat: bounds.getNorthEast().lat(), neLon: bounds.getNorthEast().lng()}, function(data) {
$.each( data.markers, function(i, marker) {
// Define Marker properties
var image = new google.maps.MarkerImage(marker.smallimg,
// This marker is 129 pixels wide by 42 pixels tall.
new google.maps.Size(42, 42),
// The origin for this image is 0,0.
new google.maps.Point(0,0),
// The anchor …Run Code Online (Sandbox Code Playgroud) 我在深色背景上绘制了一个图形,但由于轴颜色和刻度值颜色,它很难读取.如何将轴的颜色,刻度线和轴刻度值更改为白色?
jquery ×7
javascript ×3
php ×3
ajax ×2
flot ×2
graph ×2
json ×2
.htaccess ×1
c3 ×1
curl ×1
d3.js ×1
date ×1
google-maps ×1
list ×1
mod-rewrite ×1