点击列表项后,我试图通过jQuery关闭我的Bootstrap 3下拉列表。
HTML
File "test.py", line 10, in <module>
conf=(SparkConf().setMaster('local').setAppName('a').setSparkHome('/home/dirk/spark-1.4.1-bin-hadoop2.6/bin'))
File "/home/dirk/spark-1.4.1-bin-hadoop2.6/python/pyspark/conf.py", line 104, in __init__
SparkContext._ensure_initialized()
File "/home/dirk/spark-1.4.1-bin-hadoop2.6/python/pyspark/context.py", line 229, in _ensure_initialized
SparkContext._gateway = gateway or launch_gateway()
File "/home/dirk/spark-1.4.1-bin-hadoop2.6/python/pyspark/java_gateway.py", line 48, in launch_gateway
SPARK_HOME = os.environ["SPARK_HOME"]
File "/usr/lib/python2.7/UserDict.py", line 23, in __getitem__
raise KeyError(key)
KeyError: 'SPARK_HOME'
JS
<div class="btn-group">
<button type="button" data-toggle="dropdown" class="btn btn-default dropdown-toggle">10 <span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="javascript: void(0)">10</a></li>
<li><a href="javascript: void(0)">20</a></li>
</ul>
</div>
不幸的是,此解决方案不适用于IE和Chrome。 事实上,在那之后我选择了几次,下拉停止显示元素。
使用Firefox似乎没有问题。 我怎样才能解决我的问题?
谢谢
编辑
我注意到即使使用firefox我也有同样的问题
答案 0 :(得分:0)
对于那些遇到同样问题的人,我找到了解决问题的技巧。
使用
$(this).dropdown("toggle");
取代
You should change the line that says:
`MongoClient.connect("mongodb://" + process.env.IP + ":" + process.env.PORT + "/[dbname]", function (err, db){ `
You are connecting to `process.env.PORT`, but that is not the port for mongodb.
Simply use the default connection url here, it should work:
`mongodb://localhost:27017/[dbname]`