我的HTML是
function showStuff(id) {
if (document.getElementById(id).style.display === "block") {
document.getElementById(id).style.display = "none";
} else {
document.getElementById(id).style.display = "block";
}
}Run Code Online (Sandbox Code Playgroud)
而JavaScript则是
<ul class="side bar tabs">
<li id="tabs1" onclick="showStuff('tabs-1')">City</li>
<li id="tabs2" onclick="showStuff('tabs-2')">Country</li>
<li id="tabs3" onclick="showStuff('tabs-3')">Humanity</li>
</ul>
<div id="tabs-1" style="display : none">
<p>Proin elit m</p>
</div>
<div id="tabs-2" style="display : none">
<p>M massa ut d</p>
</div>
<div id="tabs-3" style="display : none">
<p> sodales.</p>
</div>Run Code Online (Sandbox Code Playgroud)
当我单击特定选项卡时,其他选项卡的内容应该被隐藏但不隐藏.这是我的所有代码.
错误是:
Page not found (404)
Request Method: GET
Request URL: 'http://127.0.0.1:8000/admin/'
Using the URLconf defined in orangeowl.urls, Django tried these URL patterns, in this order:
^product/$
^product/(?P<slug>[-\w]+)/$
The current URL, admin/, didn't match any of these.
Run Code Online (Sandbox Code Playgroud)
urls.py
from django.conf.urls import patterns, include, url
from django.conf.urls.defaults import *
from django.contrib import admin
from website.models import Product
from website.views import index
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', admin.site.urls), #Lets us access the admin page
(r'^$', 'orangeowl.website.views.index'),
)
urlpatterns = patterns('django.views.generic.list_detail',
url(r'^product/$', 'object_list',
{'queryset': …Run Code Online (Sandbox Code Playgroud) list = ['Roses are red','Sun is shining','cream comes from the bottom']
dict = {'john':'Roses are red', 'john':'Sun is shining','john':'cream comes from the bottom'}
Run Code Online (Sandbox Code Playgroud)
我希望我有道理.