Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML in function.js #874

Closed
Badetuch opened this issue Oct 24, 2018 · 4 comments
Closed

HTML in function.js #874

Badetuch opened this issue Oct 24, 2018 · 4 comments

Comments

@Badetuch
Copy link

Hey,

I want to have a teamspeak Viewer "inside" a Button like this: https://blur-group.eu/website/index.php/teamspeak/

How can i get this: https://hastebin.com/xebubisiwa into the Message box which pops up when i click the buttton?

Hope u understand me, sry 4 my bad English.

Greetings from Germany :)

@lionralfs
Copy link
Collaborator

Sure, you can use the content option to embed HTML:

const div = document.createElement("div");
div.setAttribute("class", "ts3index-viewer");
div.setAttribute("data-serverid", "235334");

const link = document.createElement("a");
link.href = "https://ts3index.com/?page=server&id=235334";
link.appendChild(document.createTextNode("TS3index.com"));
div.appendChild(link);
        
const c = document.createElement("script");
const s = document.getElementsByTagName("script")[0]; 
c.type = "text/javascript";
c.async = true;
c.src = "https://ts3index.com/viewer/script.js";
s.parentNode.insertBefore(c, s);
        
swal("........", {
  icon: "success",
  content: div
});

@Badetuch
Copy link
Author

im sorry, i dont understand how i need to adjust my code.

@t4t5
Copy link
Owner

t4t5 commented Oct 24, 2018

@Badetuch We can't write all of the code for you. I think @lionralfs has given a detailed answer on how to inject custom HTML into the modal, but you'll need to do some research on your own for it to work just the way you need.

Please keep this repo for issues and bugs related to the library itself. If you want help for your personal projects, I suggest Stack Overflow. :)

@t4t5 t4t5 closed this as completed Oct 24, 2018
@Badetuch
Copy link
Author

Im so sorry now i understand it. Thanks guys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants