I want to put a HTML link (actually it redirects to file://...) on the R Shiny user interface, so that end-users can just click it and go to that page in another tab in Chrome. Is there a way to do that? Where shall I put? In the ui.R file or in the server.R file?
I find a post here: http://www.r-bloggers.com/more-explorations-of-shiny/ but I am not sure how to use the a() function...
Note: I know how to do that (see my comments below), but since I am redirecting to a file:// destination, the link won't work. Any solutions?
Thanks!
Something like this should work:
doc <- tags$html(
tags$body(
a(href="http://www.lalala.com"))
)
cat(as.character(doc))
<html>
<body>
</body>
</html>
Related
Does anyone out there in the universe know how to change the font family for the app title that appears in the tab of your web browser? Like the one shown below
I know in the index.html file in the public folder there is the <title>React App</title> where you can change the title, but I'm not sure how to change the font.
Thanks in advance!
Kevin
You asked very good questions, in fact you can't change it. Simply go to your console. Do this :
const title = document.getElementByTagName('title');
Then press enter. After that simply write again the console:
title.
And you will see the html collection for the tag title. If you keep looking you will see a lot of options are null. Do you will understand that the tag title it's can't be modified as much as the other tags like h1 or span. You can add a javascript code to update the title let's say the number of notifications along side the title so you can do this :
document.title= (3) + is "react app".
Hope I answered your question 🙋.
Ps: I'm using my phone sorry to not provide the codes in there specific area.
I'm a very unexperienced programmer. I've been doing codeacademy javascript track but I found out that you need to put javascript in an HTML file? I want to make sure that I can write basic javascript before continuing on code academy so I downloaded brackets and when I tried to test my program with the live preview feature it said, "Open an HTML file or make sure there is an index.html file in your project in order to launch live preview. I typed this up very quickly so there are probably plenty errors but here is the code if that helps answer my question.
<!DOCTYPE html>
<html>
<body>
<h1> Daily Programmer Challenge 12/15/14 </h1>
<script type = "text/javascript">
var volume = prompt ("Enter the volume of the container that you wish to make");
var cube = math.pow(volume, 1/3);
window.document.write("The size of the container is '+cube+' width, '+cube+' high, and '+cube+' tall");
</script>
</body>
</html>
save this code that you pasted as a file called index.html and then try Bracket's live preview.
For everyone, this problem can be resolved by following steps:-
On menu bar, go to File --> Open Folder (folder which have your html file for live preview)
Select Folder
Select your html file from left side bar for live preview
Click on bolt icon on right (preview button)
All it melts down to the fact, that you need that folder(which have your file) selected to view your output in live preview.
Let me know, if it helps someone. :)
I'm attempting to add a LinkedIn Share button to our content-driven website. I've generated the embed code using the button builder, but whenever I try to actually use the button, I get a generic error:
There was a problem performing this action, please try again later.
It's been doing this for several days (since I first added the code), so I don't know if the error is on the LinkedIn side or mine. Is there any way to get a more specific error message? The code they provide is just a script tag that you paste in:
<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share"></script>
Unfortunately LinkedIn's "support" forums are limited to the various API's; there's nowhere available to submit a question regarding the build-a-button functionality. I'm hoping someone else has used this function and can point me in the right direction.
Most likely the page you are trying to share is not web accessible (local, under htaccess password or something). It looks to me like LinkedIn tries to actually look at the page you are sharing, and if it can't reach it, it gives you this message.
Most likely the url which you are sharing is not encoded, try encoding that, also follow this article for more.
The easiest way to ensure the linkedin share button works properly, is to use
<!DOCTYPE html>
instead of other alternatives.
look at the data-url attrbute. Remove the "http://" and only use "www." for your website url. That fixed my issue at least.
I found this way for validate in xhtml:
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
< script src="http://platform.linkedin.com/in.js" type="text/javascript">< /script>
< div id="linkedin">< /div>
< script type="text/javascript">
var po2 = document.createElement('script');
po2.type = 'IN/MemberProfile';
po2.setAttribute("data-id","http://www.linkedin.com/pub/luca-di-lenardo/11/4b7/3b8");
po2.setAttribute("data-format","hover");
po2.setAttribute("data-text","Luca Di Lenardo");
document.getElementById("linkedin").appendChild(po2);
< /script>
Remove the white space and it works!
If anyone is getting this error, and cannot figure out why, I recommend checking the URL of the page you're sharing with: LinkedIn Post Inspector.
So, for instance, if I were to check out how wikipedia.org looks when shared, I would visit and enter that URL, like so...
https://www.linkedin.com/post-inspector/inspect/https:%2F%2Fwww.wikipedia.org%2F
And I see...
But there's a ton of information here, showing how everything is parsed, from the description to the title to the image selection for thumbnail display...
Warning: Add an og:image tag to the page to have control over the content's image on LinkedIn.
Title: Wikipedia
Type: Article
Image: No image found
Description: Wikipedia is a free online encyclopedia, created and edited by volunteers around the world and hosted by the Wikimedia Foundation.
Author: No author found
Publish date: 6/1/2020, 6:39:59 AM
They even give you instructions on how to fix your page! Hey, got some advice for Wikipedia.org here!
Provide a metadata tag for the og:image in the page's head section. For example:
<meta name="image" property="og:image" content="[Image URL here]">
How can I place my icon before URL?
Assuming you want a favicon, here is a wonderful link about how to create one.
CSharpCorner Favicon Tutorial
This icon is called Favicon you can get more help on this at following location.
http://www.thesitewizard.com/archive/favicon.shtml
If you want to display an icon before/after all links (not a favicon as others have assumed (fair assumtion however) ) then do it in CSS.
http://www.hunlock.com/blogs/Attach_icons_to_anything_with_CSS
Edit: updated due to first comment that this is not an answer.
Your question is rather unclear, but I presume you mean you want your website to display a picture in a browser just before the actual url text. This is called a favicon.
Wikipedia explains it well.
use code below to put image.png before the url
<link rel="shortcut icon" href="image.png" />
Im using jquery UI's tabs with ajax.
I was wondering if the files that the ajax calls are gonna retrieve are supposed to be formatted starting with <html> or just the minimal html possible cause its gonna be injected into an already formatted valid xhtml file.... I hope Im making myself clear.
Thanks in advance.
If you're going to inject what you receive from the server directly into the DOM, you'll want an HTML snippet. Something like
<div>This is something <strong>injected</strong></div>
is preferred over
<html><body><div>This is something <strong>injected</strong></div></body></html>
Minimal html. All the examples on the jquery UI tabs page use HTML shards.
You should be able to spit out the HTML exactly as you would want it dropped in to place (i.e. enclosing tags are not necessary).