jQuery val无法在Chrome中运行

时间:2017-08-11 20:18:17

标签: javascript jquery

我使用这个简单的jQuery init函数,适用于Firefox但不适用于Chrome

1 partialAction)
   at Akka.Actor.UntypedActor.Receive(Object message)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.AutoReceiveMessage(Envelope envelope)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)
--- End of stack trace from previous location where exception was thrown ---
   at Akka.Actor.ActorCell.HandleFailed(Failed f)
   at Akka.Actor.ActorCell.SysMsgInvokeAll(EarliestFirstSystemMessageList messages, Int32 currentState)]
60135 2017-08-11 10:09:14.313 Host2 Akka.Remote.ReliableDeliverySupervisor Warn Association with remote system akka.tcp://ProcesamientoActorSystem@warpacb005.nead.danet:34083 has failed; address is now gated for 5000 ms. Reason is: [Akka.Remote.EndpointDisassociatedException: Disassociated at Akka.Remote.EndpointWriter.PublishAndThrow(Exception reason, LogLevel level, Boolean needToThrow) at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, PartialAction

Edit1:这里的函数叫做:

function init() {   
    var produtoCabal;
        produtoCabal = localStorage.getItem('produtoCabal').replace(/\'/g,"");;
        jQuery("#produtoCabal").val(produtoCabal);
}

控制台中没有错误

1 个答案:

答案 0 :(得分:0)

Observe()是一个原型函数。您可能正在使用第三方库(如tapestry)删除原型并用jQuery替换它。尝试将observe()更改为on() 还可以尝试将脚本标记放在正文的末尾:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>

  <script>
  </script>
</body>
</html>