我试图使用jQuery提交表单.我的代码如下
<form id="sampleForm" action="@Url.Action("submitSearch","Home")">
//Form Fields textbox
<button id="test" type="submit" ></button>
</form>
Run Code Online (Sandbox Code Playgroud)
里面document.ready有脚本
$("#sampleForm").submit(function () {
console.log("Success");
});
Run Code Online (Sandbox Code Playgroud)
但是当点击sumbit时没有发生任何事情.
我尝试了下面的代码,看看我是否已正确映射,并且工作正常
$(document).on("click", "#search-button", function () {
console.log("Success");
});
Run Code Online (Sandbox Code Playgroud)
提交表格时遗漏了什么?
当我点击song1播放按钮时,我将使用ajax作为json动态获取歌曲细节并立即在jplayer播放歌曲,其中播放/暂停下一个,之前的控件正常工作.
但是song1中的播放按钮没有改变为暂停按钮仍然作为播放按钮.
我需要将播放按钮更改为暂停按钮.如果我播放任何其他歌曲说song2,song2播放按钮应该切换到暂停按钮,当前播放的歌曲应该停止播放.请看一下线框.
function UnitPlay(ele){
var unit_id = $(ele).attr('data-song-id');
$.ajax({
url: "/get_song_details",
dataType: 'json',
data: {
song_id: song_id,
},
success: function(msg) {
var songs = msg['song_list'];
play_song(songs);
}
});
};
function play_song(songs) {
var myPlaylist = new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1",
}, [
{
title:"",
artist:"",
mp3:"",
oga:"",
poster: ""
}
],
{
swfPath: "../../dist/jplayer",
supplied: "oga, mp3",
wmode: "window",
useStateClassSkin: true,=
playlistOptions: {
autoPlay: true,
displayTime: "fast",
},
}); // end jplayer initiate
myPlaylist.setPlaylist(songs);
$("#jquery_jplayer_1").on( …Run Code Online (Sandbox Code Playgroud)我使用jqplot,我的日期是我的x轴.
我使用DateAxisRenderer插件,但我想将日期转换为我当前的语言环境.
例如,对于英语
Jan 2012
Feb 2012...
Run Code Online (Sandbox Code Playgroud)
而对于法国人
Jan 2012
Fév 2012...
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
使用django-crispy-forms我想在一行上组合两个(或更多)小部件.另请参见附带的示例.我认为应该可以使用该库,尽管文档中包含有关此问题的示例,但源代码也没有帮助.那么有没有人设法使用django-crispy-forms获得类似的结果?

这种表单所需的HTML如下所示:
<div class="control-group">
<label for="desc" class="control-label">
Description
</label>
<div class="controls controls-row">
<input class="span2" maxlength="255" type="text" id="desc">
<input class="span3" maxlength="255" type="text">
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我们如何获得jQuery Select2下拉插件中的所有元素.
我已将Select2应用于输入类型=隐藏,然后使用Ajax填充它.
现在在一个实例中,我需要获取下拉列表中出现的所有值.
这是一个输入字段.
<input type="hidden" id="individualsfront" name="individualsfront" style="width:240px" value="" data-spy="scroll" required />
Run Code Online (Sandbox Code Playgroud)
我已经应用了这个输入字段
$("#individualsfront").select2({
multiple: true,
query: function (query){
var data = {results: []};
$.each(yuyu, function(){
if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){
data.results.push({id: this.id, text: this.text });
}
});
query.callback(data);
}
});
Run Code Online (Sandbox Code Playgroud)
yuyu是来自某些AJAX调用的json,并填充了Select2.
现在我想在其他一些代码中获取Select2中的所有值.
因为我正在学习Django,所以我在virtualenv中使用了pip来安装Django.当Django Book告诉我在Python shell中键入它时,
from django import template
t = template.Template("My name is {{ name }}.")
Run Code Online (Sandbox Code Playgroud)
我得到了这个例外.我不知道如何解决这个问题.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "django/template/base.py", line 123, in __init__
if settings.TEMPLATE_DEBUG and origin is None:
File "django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "django/conf/__init__.py", line 46, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting TEMPLATE_DEBUG,
but settings are not configured. You must either define the environment variable
DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
Run Code Online (Sandbox Code Playgroud)
有人可以带我走过吗?我正在使用Mac OS …
我有一个类似的文件
email = myemail@gmail.com
email = myemail@gmail.com
email = myemail@gmail.com
Run Code Online (Sandbox Code Playgroud)
我能这样做吗?
email = myemail1@gmail.com
email = myemail2@gmail.com
email = myemail3@gmail.com
Run Code Online (Sandbox Code Playgroud)
我能在任何文本编辑器中执行此操作吗?或者还有其他方法吗?谢谢.
我目前正在尝试使用Django 1.5进入"基于类的视图".
从设计的角度来看,我想知道从哪个逻辑处理来自简单FormView中的表单的数据.
我知道所有表单验证代码都会进入该方法form_valid().但是在哪里放置处理表单数据的东西.我读到它在某种程度上不适合在form_valid()方法中加入过多的逻辑.
还有的get(),post(),get_context_data(),head(),等方法......这应该我在这种情况下使用?
我一直在查看有关此错误的无数帖子:
Undefined symbols for architecture i386:
"_OBJC_IVAR_$_UIViewController._view", referenced from:
-[ViewController viewDidLoad] in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
我已经检查过.m文件和链接库并复制包文件.我使用的是xcode 4.6.2版本.我想在ViewDidLoad中以编程方式创建Button.
对于我的网络应用程序,我需要预览用户提供的 URL。例如,在 Facebook 中,如果用户复制粘贴一个 URL,它会自动获取 URL 的内容并显示页面的预览。它是如何工作的?它是 Ajax 的一个特性吗?我需要在 Django 中做到这一点。任何教程或演示?
django ×4
jquery ×4
ajax ×1
asp.net-mvc ×1
django-forms ×1
ios ×1
iphone ×1
jplayer ×1
jqplot ×1
notepad ×1
notepad++ ×1
objective-c ×1
python ×1
python-2.7 ×1
url ×1
xcode ×1
xcode4 ×1