小编Apo*_*dis的帖子

在jquery mobile中使用谷歌地图的清晰方向示例?

尝试获得一个有效的jquery移动地图方向页面.列出了这个例子:

http://jquery-ui-map.googlecode.com/svn/trunk/demos/jquery-google-maps-mobile.html#directions_map
Run Code Online (Sandbox Code Playgroud)

但是示例代码很乱并且无法使其工作:(.宜家使用它.

http://m.ikea.com/nl/nl/stores/415/map/
Run Code Online (Sandbox Code Playgroud)

但他们也非常定制js所以很难看到会发生什么.

有没有人知道一个很容易理解的干净的例子或实现?

jquery google-maps google-maps-api-3 jquery-mobile

10
推荐指数
1
解决办法
3万
查看次数

在PhantomJS上的WebTockets上的MQTT"AMQJS0008I Socket已关闭"连接错误

JBoss的AeroGear JavaScript的通知是针对不同的信息服务和协议交互提供了统一的/类似的API适配器的集合.

问题

我正在通过WS适配器JBoss AeroGear JS MQTT编写一些QUnit测试,这依赖于Eclipse Paho MQTT JavaScript客户端.测试适用于Firefox/Chrome但在PhantomJS 1.9.7上出现AMQJS0008I Socket closed连接错误.

最初,我的测试是针对Apache Active MQ代理版本5.9.0运行的,它支持开箱即用的WebTockets上的MQTT.我还修改了它们以在WebSockets沙箱环境中使用Eclipse Paho MQTT,ws://iot.eclipse.org/ws但问题仍然存在.

如何重现?

克隆我的GitHub存储库https://github.com/tolis-e/aerogear-js-integration.签出stackoverflow分支,执行npm install然后grunt integration-iot --debug.要验证测试是否适用于Firefox/Chrome,请tests/notifier/mqttws.html在浏览器中打开.QUnit测试位于mqttws.js文件中.正如您在下面的日志中看到的,我收到了一个AMQJS0008I Socket closed错误.

有关错误原因的任何想法?我的感觉是这个问题与PhantomJS 1.9.7不支持Web套接字RFC 6455这一事实有关.看起来PhantomJS 2.x支持RFC 6455

日志

[D] ["phantomjs","qunit.begin"]
[D] ["phantomjs","onLoadFinished","success"]
[D] ["phantomjs","qunit.moduleStart","Connect / Disconnect"]
[D] ["phantomjs","qunit.testStart","Connect to and Disconnect from MQTT Server"]
[D] ["phantomjs","console","Unexpected response code: 404"]
Unexpected response code: 404 …
Run Code Online (Sandbox Code Playgroud)

javascript mqtt phantomjs paho aerogear

9
推荐指数
0
解决办法
3299
查看次数

Jquery移动应用程序奇怪的行为

我创建了一个应用程序,其中包含几个按钮,主页单击其中一个按钮,我的应用程序重定向到一些包含JQM表单的视图,包含JQM日历,文本字段,按钮和数据库等....

我的查询是,当我在Android设备上测试我的应用程序时,应用程序工作有点慢,即使我没有使用任何图像,或任何可以包含更多空间的数据.这是我的第一个查询,第二个是当我在那个时候测试我的应用程序到Android平板电脑时,表单页面出现了一段时间并且突然它会自动重定向回主页,而这个功能同样适用于Android手机.

为何这个奇怪的问题?

如果有人可以指导我,那将是我的荣幸

jquery android jquery-plugins jquery-mobile cordova

8
推荐指数
1
解决办法
918
查看次数

为什么本机String getBytes方法比自定义实现的getBytesFast慢?

运行以下代码时,Java String的本机方法getBytes()的执行似乎比自定义getBytesFast()实现.您可以使用它来验证两个字节数组是否相等.Arrays.equals(str.getBytes(), getBytesFast(str))

getBytesFast实现是此编程技巧文章(1997)中包含的实现的修改版本:http://java.sun.com/developer/technicalArticles/Programming/Performance/

我正在寻找一个记录良好的答案,解释为什么本机实现比自定义实现慢.

package com.test;

public class Performance {

    public static void main(String args[]) {

        final String str = "This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance …
Run Code Online (Sandbox Code Playgroud)

java optimization performance

6
推荐指数
2
解决办法
4085
查看次数

动态JQuery移动导航

我遇到了jQuery的问题以及如何动态处理网址.如果我有一个带链接的页面,每个人都有一个id来调用一个函数和一个id,我想做的就是这个.如何更改特定链接的URL并将该URL用作书签.以下是我的代码

<div data-role="page" id="#listview">
<div data-role="header">
    <h1>List</h1>
</div>

<div data-role="content">   
<ul data-role="listview" id="carlist">
  <li><a href="#" onclick="cardetails('1')">Acura</a></li>
  <li><a href="#" onclick="cardetails('2')>Audi</a></li>
  <li><a href="#" onclick="cardetails('3')>BMW</a></li>
</ul>
</div>

<div data-role="footer">
    <h4>Page Footer</h4>
</div>
Run Code Online (Sandbox Code Playgroud)

因此,当您单击列表中的汽车时,名为cardetails且参数为1的函数将返回到服务器并获取id = 1的汽车的cardetails.我的问题不是这样,但是当JSON数据返回时,我希望将url更改为cardetails#1或类似的东西.因此,它可以识别用户的位置,浏览器可以将其添加到其历史记录中,如果用户为该URL添加书签,则浏览器将能够找到具有相同数据的确切页面.

javascript jquery history bookmarks jquery-mobile

5
推荐指数
1
解决办法
7194
查看次数

进度条与百分比jquery移动

我正在尝试使用jquery mobile开发移动应用程序,因为我正在使用Web服务.我希望它显示一个完成百分比的进度条.

javascript jquery jquery-mobile progress-bar

4
推荐指数
1
解决办法
2万
查看次数

PhoneGap移动应用程序上的谷歌地图方向

我试图使用您创建的示例,使用谷歌地图创建方向的简洁示例.我使用的代码是:

<!doctype html>
<html lang="en">
<head>
    <title>jQuery mobile with Google maps</title>

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<link href="../themes/theme1.css" rel="stylesheet" type="text/css">
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3&sensor=false&language=en"></script>
    <script type="text/javascript">

        var map,
            currentPosition,
            directionsDisplay, 
            directionsService;

        function initialize(lat, lon)
        {
            directionsDisplay = new google.maps.DirectionsRenderer(); 
            directionsService = new google.maps.DirectionsService();

            currentPosition = new google.maps.LatLng(lat, lon);

            map = new google.maps.Map(document.getElementById('map_canvas'), {
               zoom: 15,
               center: currentPosition,
               mapTypeId: google.maps.MapTypeId.ROADMAP
             });

            directionsDisplay.setMap(map);

             var currentPositionMarker = new google.maps.Marker({
                position: currentPosition,
                map: map,
                title: "Current position"
            });

            var infowindow = new …
Run Code Online (Sandbox Code Playgroud)

maps jquery

2
推荐指数
1
解决办法
1万
查看次数

没有页面刷新的jQuery Mobile的Ajax请求

我通过Ajax POST提交一个简单的表单并获取JSON响应,并使用该响应将数据填充到带滑块的定制音频播放器中.

音频播放器滑块功能在Ajax POST之前工作.但是,在我提交表单后,似乎jQuery Mobile正在刷新页面,在刷新之后,滑块被破坏.

我得到的错误消息是:"错误:在初始化之前无法调用滑块上的方法;尝试调用方法'刷新'"

我的表单代码如下:

<form name="test" method="post">
    <input type="hidden" name="action" value="test.php">
    <input type="number" name="id" />
    <button data-icon="star" onclick="onFormSumbit();">Submit</button>
</form>
Run Code Online (Sandbox Code Playgroud)

我的提交功能如下:

function onFormSumbit() {
    $.ajax({
        type: $('form').attr('method'),
        url: $('form input[name=action]').attr('value'),
        data: $('form').serialize(),
        dataType: 'json',
        success: function(response, textStatus, XMLHttpRequest) {
            if (response.error) {
                console.log('ERROR: ' + response.error);                
            } else {
                mediaSource = response.url;                 
                console.log('URL: ' + response.url);
                console.log('ARTIST: ' + response.artist);
                console.log('TITLE: ' + response.title);
            }
        }
    });
}
Run Code Online (Sandbox Code Playgroud)

我的滑块编码如下:

<input type="range" id="slider" value="0" min="0" max="100" step="0.01" data-highlight="true" /> …
Run Code Online (Sandbox Code Playgroud)

forms jquery post jquery-mobile

1
推荐指数
1
解决办法
3887
查看次数