到目前为止这是我的代码:
<div style="width:100px;height:100px;background:red">
ssssssssssssssssssssssssssssssssssssss
</div>
Run Code Online (Sandbox Code Playgroud)
然而,
word-wrap:break-word;
word-break:break-all;
Run Code Online (Sandbox Code Playgroud)
并不是很有用,因为它无法在Firefox上进行自动换行. 我可以用CSS做什么?
这是我的代码,我认为它可能有一些错误:
var bounds_array;
google.maps.event.addListener(map,'bounds_changed', function (){
var bounds_=map.getBounds();
if(bounds_){
var leftBottom=[bounds_.getSouthWest().lat(),bounds_.getSouthWest().lng()]
var rightTop=[bounds_.getNorthEast().lat(),bounds_.getNorthEast().lng()]
bounds_array=[leftBottom,rightTop];
}
});
function check_is_in_or_out(marker){
var leftBottom=bounds_array[0],rightTop=bounds_array[1];
var marker_p=[marker.getPosition().lat(),marker.getPosition().lng()];
if(marker_p[0]<leftBottom[0]||marker_p[0]>rightTop[0]||
marker_p[1]<leftBottom[1]||marker_p[1]>rightTop[1])return 0;//0 is out
else return 1;//1 is in
}
Run Code Online (Sandbox Code Playgroud)
这段代码是否足以检查边界是否存在?
使用此代码:
{% for o in [1,2,3] %}
<div class="{% cycle 'row1' 'row2' %}">
{% cycle 'row1' 'row2' %}
</div>
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
我得到一个TemplateSyntaxError:
Could not parse the remainder: '[1,2,3]' from '[1,2,3]'
Run Code Online (Sandbox Code Playgroud)
有没有办法在模板中构建列表?
这是错误:
(mysite)zjm1126@zjm1126-G41MT-S2:~$ /usr/local/mongodb/bin/mongod
/usr/local/mongodb/bin/mongod --help for help and startup options
Wed Apr 27 10:02:41 [initandlisten] MongoDB starting : pid=2652 port=27017 dbpath=/data/db/ 32-bit
** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
** see http://blog.mongodb.org/post/137788967/32-bit-limitations
** with --dur, the limit is lower
Wed Apr 27 10:02:41 [initandlisten] db version v1.8.1, pdfile version 4.5
Wed Apr 27 10:02:41 [initandlisten] git version: a429cd4f535b2499cc4130b06ff7c26f41c00f04
Wed Apr 27 10:02:41 [initandlisten] build sys info: Linux bs-linux32.10gen.cc 2.6.21.7-2.fc8xen #1 SMP …Run Code Online (Sandbox Code Playgroud) 这是我的代码:
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django import http
from django.http import HttpResponse
def main(request, template_name='index.html'):
HttpResponse.set_cookie('logged_in_status', 'zjm1126')
context ={
'a':a,
'cookie':HttpResponse.get_cookie('logged_in_status'),
}
return render_to_response(template_name, context)
#return http.HttpResponsePermanentRedirect(template_name)
Run Code Online (Sandbox Code Playgroud)
它引发了这个例外:
unbound method set_cookie() must be called with HttpResponse instance as first argument (got str instance instead)
Run Code Online (Sandbox Code Playgroud)
我能做什么?
我不想使用html文件,但只有django我必须发出POST请求.
就像urllib2发送get请求一样.
当我使用Django shell时,它显示错误; 这是错误:
>>> from django.db import models
>>> class Poll(models.Model):
... question = models.CharField(max_length=200)
... pub_date = models.DateTimeField('date published')
...
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "D:\Python25\lib\site-packages\django\db\models\base.py", line 51, in __new__
kwargs = {"app_label": model_module.__name__.split('.')[-2]}
IndexError: list index out of range
Run Code Online (Sandbox Code Playgroud)
我能做什么?
我正在使用raphaeljs,我想在svg中显示html(不仅是文本),
所以我使用这段代码:
var r = Raphael("holder", 200, 300);
var t = r.text(10, 10, "ssdwqdwq");
t.node.innerHTML='dddd'
Run Code Online (Sandbox Code Playgroud)
但我不能改变svg的内容,所以我在firebug中安装它,
console.log(t.node)
Run Code Online (Sandbox Code Playgroud)
它显示了这个:
<text x="10" y="13.5" text-anchor="middle" style="font: 10px "Arial";" font="10px "Arial"" stroke="none" fill="#000000">
Run Code Online (Sandbox Code Playgroud)
所以如何在svg上使用javscript更改文本
谢谢
这是我的代码:
a = {0:'000000',1:'11111',3:'333333',4:'444444'}
for i in a:
print i
Run Code Online (Sandbox Code Playgroud)
表明:
0
1
3
4
Run Code Online (Sandbox Code Playgroud)
但我想要它显示:
4
3
1
0
Run Code Online (Sandbox Code Playgroud)
那么,我该怎么办?
我认为他们是一回事,但我的老板说这是不对的.有人可以解释这个区别吗?