How can I add embed function to a page - javascript

How can I add this function to something: http://awesomescreenshot.com/0ec17ri8dc
Its from this page.
Notice when you click on it a popup appears with the generated html to add the code somewhere. Have ben unable to find a good google search query that doesn't bring up irrelevant pages.
Thanks in adv.

Here's a quick solution.
If you know some basic jQuery you won't have problems with understanding the code but feel free to ask if you need any help.
Keep in mind that the code won't trigger a pop-up, it's just to get the embed code. I'd suggest using some plugin for this, fancybox is a good one.

Related

Loading animation upon button click (Pardot form)

Because it takes a long time for a Pardot form to get submitted I thought it might be best if I'd add a little loading animation to it just so people would not smash the button to make sure it works (or close the tab).
The difficulties:
I am no developer, have very little knowledge of JS
the rigid way a form is set up makes it even harder because I can't seem to fashion an existing solution with my current knowledge.
Can't change the existing HTML structure or add classes (maybe you can with JS?)
I'd want to do something simple preferably via only HTML/CSS but I think JS will be needed.
This is the sort of thing I am talking about: http://jsfiddle.net/AndrewDryga/GY6LC/
-
And here is an example form I need to make this happen: http://www2.idioplatform.com/l/20742/2018-04-18/5c8mk3
Can you give me pointers how should I go about making this work?
Or where to look for help with implementing this?
I am happy to provide any additional details needed.
Thank you!
You can add a class directly to your button in the Layout Template (Pardot) - see attached. That way you can try the link code #lewis referenced...be sure to create a new layout template and add the javascript there.

How do I display a alert on a website?

I wanted to have a message pop up in the middle of the page of my website when there is a important announcement like the one below. Any ideas of what to use. I tries looking at the code but I have no idea how to get it to work. Any ideas will be appreciated.
Image (My Idea of how it should look)
It looks like you have tagged 'javascript' on this question, so I will show you the most common way to do it completely using javascript.
Use the alert() function. The alert function takes one parameter — the text that you want to show. All browsers will present this in a different way. This is really easy to do and is recommended especially if you are just starting.
An example of implementing this on your HTML website:
<script type="text/javascript">
alert('My message goes here');
</script>
If you want to change the way this looks, you will have to use an HTML modal. By using that, you can customize the HTML&CSS to look exactly like the picture you attached.
To get started with that, I recommend you check out W3Schools tutorial on this: https://www.w3schools.com/howto/howto_css_modals.asp

sharing alternatives similar to addthis/sharethis

Please have a look at http://500px.com/photo/3977429?from=popular. Down in the right corner, theres a sharing box. It looks pretty similar to sharethis. But, afaik, sharethis doesnt have embed or submit for example, and im looking for those options. Does anyone know which plugin is used here? Thanks
On the page you linked to, they didn't use anything like sharethis or addthis - they rolled their own. Looking at the code, its clear that they went to facebook, got the facebook like button, embedded it - then wen to google, got the google plus button, etc... and made a grid of them.
You can stylize the sharethis buttons with css to pretty much any extent,
or you can add a grid like that of your own.
The available alternatives to sharethis.com are :
addthis.com
addtoany.com
socialmarker.com
I'm sure there a a lot more out there, but those seem to be the most popular.
If you want something custom like they have and want access to the buttons
here are some sets of images you may be able to use:
http://speckyboy.com/2009/01/26/30-amazingly-creative-social-bookmarks-icon-sets/
Inspecting the source leads me to believe that it is custom work. The images, links and such are placed in the HTML serverside. Only the stumbleupon is pulled from stumbleupon itself. But also not trough some third party service like sharethis.

Google Chrome Extension

I have a few questions that need answering. I am trying to create a Google Chrome extension and I need every page to be monitored for a keyboard action. I have added a content script that runs on the page load and when you click the keyboard shortcut an alert is shown.
What I want to do is instead of an alert have something like fancybox, thickbox, etc... however all of those are jquery plugins which adds a dependency to my js file. I tried launching the plugin before my js file but it still does not work.
I run the content script from the manifest.json file with
"content_scripts": [
{
"matches":["http://*/*", "https://*/*"],
"run_at":"document_start",
"js":["jquery.simplemodal.1.4.1.min.js", "shortcuts.js"]
}
],
I cannot execute an HTML page where the js is located I have to use a js file.
so what I want to know is if either there is a way to include the plugin without physically adding it to my file or if there is a way to call the js file which then just executes an HTML file or if there is another way of creating a popup screen like fancybox that is already included in js.
Another question I have is if there was a way to embed HTML into an alert box (this is a backup if I cannot figure out the above question)
and finally does anyone know of an execution command for x-webkit-speech? I want the command to start recording and somehow some people have used some commands (none of which answer my question) so someone somewhere knows a little more about this function then me. I would really appreciate help with this I am really close to finishing my program and these are my last holdups with these questions answered I will be able to release my extension. Please help where you can I have researched and researched everywhere all different ways of trying these things and none have worked.
edit:
You were correct (JHurrah) including the jquery actually solved the problem I really appreciate that. simple yet successful I just assumed the jquery provided was enough but I guess everyone knows what happens when you assume especially when programming.
NewTang I have already looked at that website however I will relook at it and see if I missed anything thanks for the help
yeah see I don't have that I have link edit and flag I looked all over and did not see an add comment button at all... :[
since simplemodal is a plugin it depends on jquery, try including jquery in your manifest before the other scripts.
"js":["jquery-1.5.2.min.js", "jquery.simplemodal.1.4.1.min.js", "shortcuts.js"]
I"m a little confused by your question, but I'll give it my best shot.
1) I think you're trying to ask: Can I use a content_script to inject HTML. The answer is yes, but only through Javascript. So, you could have something like:
//using jquery
$("body").append("Hi, I'm on the bottom of the page");
Your javascript would have to create or load the HTML that would get inserted into the page.
2) No, no HTML in an alert box. You're on the right track with using lightbox, thickbox, etc.
3) There's not many resources on x-webkit-speech, but maybe this can help you get going: http://nooshu.com/experimenting-with-webkit-form-speech-input

How to create a small widget with JavaScript

I really don't know how to describe it, but if you understood it and had experience on that field, may be you can help me with something 'Open Source' and 'Ready-made'.
I want to create something like a box 'or widget', where you can change its content by hitting some buttons on the top of the box. (Hey the box is on a web page and this should use Ajax and Javascript).
I have tried some ready scritps, but I found them limited and they drive me crazy, JS frameworks also don't seems to offer such solution.
Any body have any idea on that field?
Just because the box is on a Web page doesn't mean it should use AJAX, Omar. Have you thought about using a third-party solution like ClearSpring or WidgetBox? If you need to put your widget onto Myspace, you'll want one of these.
That said, I've taken a couple of JavaScript-only runs at this problem; see Twitterati and Put Your Digg In A Box for examples, and my Global Widget Summit presentation for explanations.
Have you tried Jquery?
Visit www.jquery.com
Some example can be found at
http://www.openjs.com/scripts/events/keyboard_shortcuts/
Also please check the In-place editing example at
http://www.appelsiini.net/projects/jeditable
http://docs.jquery.com/Tutorials:Edit_in_Place_with_Ajax

Categories

Resources