I don't know GreaseMonkey at all. I'm sure I'm not calling the function correctly. I created a new User Script with the Name "Trouble" and the following contents:
Code: Select all
function FindTrouble() {
location.href='http://trouble/ticket/'+prompt('Enter%20Trouble%20Ticket#:','');
}
I changed my bookmarklet to this:
But i get the following error:
Code: Select all
ReferenceError: FindTrouble is not defined
I also tried this:
But i get the following error:
Code: Select all
ReferenceError: Trouble is not defined
I removed the function declaration and refreshed a web page, then got into an endless loop going to my page, so it worked, but not how I want.
Is there a way to declare it with a function name and have my bookmarklet call that function, or would that still be considered being executed from the page?
I don't know GreaseMonkey at all. I'm sure I'm not calling the function correctly. I created a new User Script with the Name "Trouble" and the following contents:
[code]function FindTrouble() {
location.href='http://trouble/ticket/'+prompt('Enter%20Trouble%20Ticket#:','');
}[/code]
I changed my bookmarklet to this:
[code]javascript:FindTrouble();[/code]
But i get the following error:
[code]ReferenceError: FindTrouble is not defined[/code]
I also tried this:
[code]javascript:Trouble.FindTrouble();[/code]
But i get the following error:
[code]ReferenceError: Trouble is not defined[/code]
I removed the function declaration and refreshed a web page, then got into an endless loop going to my page, so it worked, but not how I want. :-D
Is there a way to declare it with a function name and have my bookmarklet call that function, or would that still be considered being executed from the page?