jQ.ajax(js.Dictionary(
"url" -> "http://www.w3.org/People/Berners-Lee/card#i".asInstanceOf[js.Any],
"success" -> { (data: js.Any, textStatus: js.String, jqXHR: JQueryXHR) =>
console.log(s"data=$data,text=$textStatus,jqXHR=$jqXHR");
js.Dictionary().asInstanceOf[js.Dynamic]
}.asInstanceOf[js.Any],
"error" -> { ( jqXHR: JQueryXHR, textStatus: js.String, errorThrow: js.String) =>
console.log(s"jqXHR=$jqXHR,text=$textStatus,err=$errorThrow");
js.Dictionary().asInstanceOf[js.Dynamic]
}.asInstanceOf[js.Any],
"type" -> "GET".asInstanceOf[js.Any]
).asInstanceOf[JQueryAjaxSettings]
)
Hi,
You cannot use .asInstanceOf[js.Any] like this and expect it to work. You have to use the appropriate implicit conversions, which are not no-ops for all types. So use ascription x: js.Any instead.
Cheers,
Sébastien
--
You received this message because you are subscribed to the Google Groups "Scala.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-js+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
success = (data: js.Any, textStatus: js.String, jqXHR: JQueryXHR) =>{console.log(s"data=$data,text=$textStatus,jqXHR=$jqXHR");js.Dictionary()},error = ( jqXHR: JQueryXHR, textStatus: js.String, errorThrow: js.String) => {console.log(s"jqXHR=$jqXHR,text=$textStatus,err=$errorThrow");js.Dictionary()},`type` = "GET")
val json = jsObj[org.scalajs.jquery.JQueryAjaxSettings](url = "http://www.w3.org/People/Berners-Lee/card",
success = (data: js.Any, textStatus: js.String, jqXHR: JQueryXHR) =>{ console.log(s"data=$data,text=$textStatus,jqXHR=$jqXHR"); js.Dictionary() }, error = ( jqXHR: JQueryXHR, textStatus: js.String, errorThrow: js.String) => { console.log(s"jqXHR=$jqXHR,text=$textStatus,err=$errorThrow"); js.Dictionary() }, `type` = "GET" )
jQ.ajax(json)