PDA

View Full Version : please help on a small js syntax error



hygo
21 Jun 2007, 8:33 AM
<script type="text/javascript">
Ext.onReady(function(){
Ext.get('okButton').on('click', function(){
var msg = Ext.get("msg");
msg.load({
url: ["http://localhost/scuttle/ajax_response.php"],
//params: "username=" + Ext.get('username').dom.value,
params:{"username=" + Ext.get('username').dom.value,"password=" + Ext.get('password').dom.value},
text: "Updating..."
});
msg.show();
});
});
</script>I want to assign two paramaters 'username' and 'passowrd', so i write a new line but it returns an error of "missing : after property id" at

params:{"username=" + Ext.get('username').dom.value,"password=" + Ext.get('password').dom.value},

para
21 Jun 2007, 8:35 AM
Try this.



<script type="text/javascript">
Ext.onReady(function(){
Ext.get('okButton').on('click', function(){
var msg = Ext.get("msg");
msg.load({
url: ["http://localhost/scuttle/ajax_response.php"],
params:{username: Ext.get('username').dom.value, password: Ext.get('password').dom.value},
text: "Updating..."
});
msg.show();
});
});
</script>




Objects are denoted as follows:


var objectName = {
property: propertyValue,
property2: property2Value};

Let me know if this helps

hygo
21 Jun 2007, 8:42 AM
works! thanks for your quick reply Para