Can't switch tab and replace value of an input and call a f() same time.
Posted
by marharépa
on Stack Overflow
See other posts from Stack Overflow
or by marharépa
Published on 2010-04-25T08:49:24Z
Indexed on
2010/04/25
8:53 UTC
Read the original article
Hit count: 232
Hi!
I feel sorry of askin all my little thingys here, but i can't find the answer via google. :(
I'd like to switch tabs, replace an input value and call a function by one click.
THE JS:
function ApplyTableId(id) {
var $tabs = $('#tabs').tabs();
$('a.stat').click(function() {
$tabs.tabs('select', 2); // switch to third tab
});
$('tableId').val('ga:'+id); // replace the input with id=tableId's val
getAccountFeed(); // call an other function
}
The another JS, which will be called by the first script:
function getAccountFeed() {
var myFeedUri =
'https://www.google.com/analytics/feeds/accounts/default?max-results=50';
myService.getAccountFeed(myFeedUri, handleAccountFeed, handleError);
}
This is what i want to call, and here is the HTML:
TAB1:
<a class="stat" onClick="return ApplyTableId(this.getAttribute('id'));" id="7777777" />asd</a>
TAB3:
<input type="text" value="asd" id="tableId"/>
Please tell me, what i did wrong :(
© Stack Overflow or respective owner