问题列表 - 第24413页

我可以在Itunes LP环境中使用跨站点XmlHttpRequest吗?

Itunes基于Webkit平台,由于安全策略,我们无法在JavaScript中使用跨站点XmlHttpRequest.但是,作为例外,我们可以使用特殊标头来实现.这是源代码,我在Safari中成功完成了它:

var url = 'http://mysite.net/canvas.php';   

var mybody = "<?xml version='1.0' charset='utf-8'?><person><name>Arun</name></person>";
var http = new XMLHttpRequest();

http.open("POST", url, true);   
http.setRequestHeader("X-PINGOTHER", "pingpong");
http.setRequestHeader('Content-Type', 'application/xml');

http.setRequestHeader("Content-length", mybody.length);
http.setRequestHeader("Connection", "close");   
http.send(mybody);
Run Code Online (Sandbox Code Playgroud)

我将xml数据发送到我的服务器并在Safari浏览器中成功获得返回响应,但我无法在iTunes LP环境中执行此操作.那有什么问题呢?

javascript itunes

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

如何将'(1,2,3,4)改为'1,2,3,4'

这是我的代码:

    var a='(1,2,3,4)'
    a=a.slice(-1,1)
    alert(a)
Run Code Online (Sandbox Code Playgroud)

我没有打印任何东西.

谢谢

javascript string

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

如何在mysql中将默认日期时间设置为系统日期时间

我正在尝试将列的默认日期时间设置为系统日期时间.它显示了一个错误

"InsertionDate"的默认值无效

alter table `vts`.`tblpickpoint` 
  add column `InsertionDate` 
      datetime DEFAULT 'Now()' NULL after `PickPointLatLong`
Run Code Online (Sandbox Code Playgroud)

mysql mysql-error-1067

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

使用Android模拟器振铃自己

我正在谷歌的Android模拟器上开发一个小应用程序.我试图弄清楚如何模拟从一个仿真器实例到另一个仿真器(都在我的计算机上运行)的电话呼叫.有谁知道如何做到这一点?

非常感谢你.

android android-emulator

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

启动现代编译时出错

在我的servlet中,我使用的是Tomcat 5.0,而JRE是1.5.0但是当我点击URL时它会出错.就像我创建一个我的项目的war文件并在tomcat中部署它工作正常.这意味着我的eclipse配置只有问题

错误是: -

Apr 5, 2010 3:20:22 PM org.apache.jasper.compiler.Compiler generateClass
SEVERE: Javac exception 
Error starting modern compiler
    at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:69)
    at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:942)
    at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) …
Run Code Online (Sandbox Code Playgroud)

java eclipse compiler-construction ant tomcat

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

如何区分两个线程

我的程序中有以下代码:

Thread getUsersist, getChatUsers;

getUsersList = new Thread(this, "getOnlineUsers");
getUsersList.start();
getChatUsers = new Thread(this, "getChatUsers");
getChatUsers.start();
Run Code Online (Sandbox Code Playgroud)

在run()中,我想知道哪个线程正在使用run().如果它的"getOnlineUsers"我会做一些事情,如果它是"getChatUsers"我将做其他事情.那么我怎么知道哪个线程正在使用run()?

java multithreading

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

初学者Facebook应用指南

有人能指点我做一个好的初学者制作Facebook应用程序的指南吗?

facebook

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

输入类型文本和onKeyDown在IE下不起作用

我正在编写一个WWW应用程序,它必须在IE下运行.我有在FF下运行的代码的问题,但我不能让它在IE下运行.

// JS代码

function test()
{
    if (window.event.keyCode == 13)
        window.location.assign("myPage.php");
}
Run Code Online (Sandbox Code Playgroud)

我在window.location和location.href周围尝试了一些类似的方法,也是document.location.我已经读过IE有问题,所以我要求一个解决方案.

目标是,在输入一些文本后重新加载该页面<input type='text' name='item_code' onKeyDown='test()'>,然后单击Enter.因此结果类似于在文本输入下方按提交类型按钮.

在IE中,它重新加载相同的页面,没有任何反应.在FF它正确工作.

更新1:

由bobince给出的尝试解决方案.

<input type='text' name='item_code'>

<script type='text/javascript' >

document.getElementsByName('item_code')[0].onkeydown = function(event)
{
    if (event == undefined) { event = window.event; }
    if (event.keyCode == 13) { window.location = 'myPage.php'; }

    alert('1');
}

</script>";
Run Code Online (Sandbox Code Playgroud)

问题是,如果有alert('1');行,页面显示警报和重定向,如果没有alert('1');行,页面只是重新加载到自身.我不知道这里有什么问题?

更新2:

我正在粘贴最终适合我的东西.

<form action='mainPage.php' method='POST'>
    <input type='text' name='item_code'>
</form>

<script type='text/javascript' >
    document.getElementsByName('item_code')[0].onkeydown= function(event)
    {
        if (event == undefined)
        {    
            event = …
Run Code Online (Sandbox Code Playgroud)

html javascript dhtml javascript-events

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

PHP函数将unicode转换为特殊字符?

是否有PHP函数来处理下面的编码?

  .replaceAll("\u00c3\u0080", "&Agrave;")
  .replaceAll("\u00c3\u0081", "&Aacute;")
  .replaceAll("\u00c3\u0082", "&Acirc;")
  .replaceAll("\u00c3\u0083", "&Atilde;")
  .replaceAll("\u00c3\u0084", "&Auml;")
  .replaceAll("\u00c3\u0085", "&Aring;")
  .replaceAll("\u00c3\u0086", "&AElig;")
  .replaceAll("\u00c3\u00a0", "&agrave;")
  .replaceAll("\u00c3\u00a1", "&aacute;")
  .replaceAll("\u00c3\u00a2", "&acirc;")
  .replaceAll("\u00c3\u00a3", "&atilde;")
  .replaceAll("\u00c3\u00a4", "&auml;")
  .replaceAll("\u00c3\u00a5", "&aring;")
  .replaceAll("\u00c3\u00a6", "&aelig;")
  .replaceAll("\u00c3\u0087", "&Ccedil;")
  .replaceAll("\u00c3\u00a7", "&ccedil;")
  .replaceAll("\u00c3\u0090", "&ETH;")
  .replaceAll("\u00c3\u00b0", "&eth;")
  .replaceAll("\u00c3\u0088", "&Egrave;")
  .replaceAll("\u00c3\u0089", "&Eacute;")
  .replaceAll("\u00c3\u008a", "&Ecirc;")
  .replaceAll("\u00c3\u008b", "&Euml;")
  .replaceAll("\u00c3\u00a8", "&egrave;")
  .replaceAll("\u00c3\u00a9", "&eacute;")
  .replaceAll("\u00c3\u00aa", "&ecirc;")
  .replaceAll("\u00c3\u00ab", "&euml;")
  .replaceAll("\u00c3\u008c", "&Igrave;")
  .replaceAll("\u00c3\u008d", "&Iacute;")
  .replaceAll("\u00c3\u008e", "&Icirc;")
  .replaceAll("\u00c3\u008f", "&Iuml;")
  .replaceAll("\u00c3\u00ac", "&igrave;")
  .replaceAll("\u00c3\u00ad", "&iacute;")
  .replaceAll("\u00c3\u00ae", "&icirc;")
  .replaceAll("\u00c3\u00af", "&iuml;")
  .replaceAll("\u00c3\u0091", "&Ntilde;")
  .replaceAll("\u00c3\u00b1", "&ntilde;")
  .replaceAll("\u00c3\u0092", "&Ograve;")
  .replaceAll("\u00c3\u0093", "&Oacute;")
  .replaceAll("\u00c3\u0094", "&Ocirc;")
  .replaceAll("\u00c3\u0095", …
Run Code Online (Sandbox Code Playgroud)

php unicode

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

画三角iphone

我如何在iphone中绘制三角形.....这有什么api吗?你可以发一些代码......

iphone

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