Besttoolbars Development network

Back to Besttoolbars main site

 

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
remote javascript files

 
Post new topic   Reply to topic    BestToolbars.Net Forum Index -> General questions
Author Message
CatalinB



Joined: 10 Dec 2009
Posts: 30

PostPosted: Fri Feb 12, 2010 4:01 pm    Post subject: remote javascript files Reply with quote

I'm trying to include a remote javascript file but I can't make it working (can't call any function/variable from it).

Could you provide a full example please?
Back to top
Admin
Site Admin


Joined: 22 Aug 2006
Posts: 1055

PostPosted: Mon Feb 15, 2010 11:31 am    Post subject: Reply with quote

Which function are you trying to call from remote JS?
The only function to be called is Launch() function that should be assigned to a button/menu item
Back to top
CatalinB



Joined: 10 Dec 2009
Posts: 30

PostPosted: Mon Feb 15, 2010 12:15 pm    Post subject: Reply with quote

Admin wrote:
Which function are you trying to call from remote JS?
The only function to be called is Launch() function that should be assigned to a button/menu item


I have a javascript library containing several functions and variables. I want to be able to launch some functions when the page is loaded (Document complete event).
Back to top
Admin
Site Admin


Joined: 22 Aug 2006
Posts: 1055

PostPosted: Tue Feb 16, 2010 6:43 am    Post subject: Reply with quote

We have tested with remote JS and DocumentComplete function, all works fine

http://www.besttoolbars.net/script.js

you should see an alert from DocumentComplete
Back to top
CatalinB



Joined: 10 Dec 2009
Posts: 30

PostPosted: Tue Feb 16, 2010 7:45 am    Post subject: Reply with quote

Admin wrote:
We have tested with remote JS and DocumentComplete function, all works fine

http://www.besttoolbars.net/script.js

you should see an alert from DocumentComplete


Well, I managed to see this alert. The problem is not with alerts, but with variables and functions. It would be more than good to have the possibility to access some already done functions and variables (maintained on a remote server).
For example, I wish to know if it's possible to use jQuery for instance and to have full benefit of this wonderful tools.
Back to top
Admin
Site Admin


Joined: 22 Aug 2006
Posts: 1055

PostPosted: Tue Feb 16, 2010 8:30 am    Post subject: Reply with quote

I don't mean only alerts. You can put any function under DocumentComplete() to be called.

As for jQuery, you can use it in Bubbles and Banners. No guarantee it works in our Custom Scripts
Back to top
CatalinB



Joined: 10 Dec 2009
Posts: 30

PostPosted: Tue Feb 16, 2010 8:42 am    Post subject: Reply with quote

Admin wrote:
I don't mean only alerts. You can put any function under DocumentComplete() to be called.

As for jQuery, you can use it in Bubbles and Banners. No guarantee it works in our Custom Scripts


Ok, I got it. Do you think that's possible to access the MainWindow from Bubble or Banner using jQuery?
Back to top
Admin
Site Admin


Joined: 22 Aug 2006
Posts: 1055

PostPosted: Tue Feb 16, 2010 9:07 am    Post subject: Reply with quote

It depends on jQuery implementation
Back to top
CatalinB



Joined: 10 Dec 2009
Posts: 30

PostPosted: Tue Feb 16, 2010 9:16 am    Post subject: Reply with quote

Admin wrote:
It depends on jQuery implementation


Would you be so kind to provide more details please?
I'm having this scenario: ok, the jQuerty is included in a html page that will be put in a banner in my toolbar. I want to access from this banner the object MainWindow.document.parentWindow.
Back to top
Admin
Site Admin


Joined: 22 Aug 2006
Posts: 1055

PostPosted: Tue Feb 16, 2010 9:32 am    Post subject: Reply with quote

You can try to do it, but we cannot guarantee it will work.

In general, there is IExplorer=tool.explorer;

to address an HTML page opened in the browser from Bubble/banner. You can change colors on
the page, highlight specific words, make the page analysis and many other useful tricks.

The example below will change the background color of the page.

IExplorer.body.style.backgroundColor="#ff0000";

please, read our JS documentation for more information
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BestToolbars.Net Forum Index -> General questions All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group

Copyright c Softomate, 2010. All Rights Reserved
Terms of Service | Privacy Policy