简体   繁体   中英

Call Javascript Specific Function from external file with same name that other

I have a custom function named tooltip() for another issue but I need to use the tooltip() function of bootstrap.

How could I call those specific tooltip() function of bootstrap?

Executing this I am calling mi local function tooltip():

$('[data-toggle="tooltip"]').tooltip();

Thanks

You are overwriting the other tooltip function with your own. You cannot address the function of bootstrap any more.

You have a few options:

1) do not load your own javascript tooltip function on that page

2) rename your own javascript function to something else

3) load your own javascript BEFORE the bootstrap so your function gets overwritten, not bootstraps. This will result in your function not being usable any more which is probably not a solution.

I would choose option 2). It's the only clean solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM