The problem I am facing is this:
<div data-role="footer">
<a class="ui-btn" href="RV2.cshtml">Anchor</a>
<p>THINGS WRITTEN IN FOOTER</p>
</div>
In href, I am passing the name of file as it is, because RV2.cshtml is in Views folder and this file, from which I am calling RV2, is also in Views folder. But its not working this way. I have to put RV2.cshtml in Assets folder and then this HTML link starts working.
Why is that?? And I want all my views in Views folder not in Assets folder. What should I do to achieve that??
Here is the snapshot of folders:
Now this works fine.
But I want it the following way:
It is just not possible for the WebView to access stuff outside assets. The files outside get compiled, while assets are not being touched and just packaged with the APK file.
Related
Why won't my images from my computer show up in my html file I had no issue using images from the web using the url. I saved my html file, css and images all in on folder but it doesn't show up on the website. This is the code I used using Sublime Text Editor.
<div>
<img src="/images/profile-pic.jpg"/>
<h1 id="myname">John Smith</h1>
<h3>Web developer</h3>
<p>{{ pause and ponder }}</p>
</div>
</div class="intro">
Another easy way to do this.
Go to your files on your system, navigate to the folder where your image is stored right click and click properties then copy out the address there.
Just give a correct path of the image in the html file and remove the forward slash (/) behind the path.
Most likely you're in a new directory and need to come back up one level. You could try:
<img src="../images/profile-pic.jpg"/>
Now on folder structure, this is how you arrange your documents.
First create a folder for your entire website. Let's call it "Codes"
Then in codes add the HTML file and name it "index"(easier for the browser to recognize when hosting) the along side the index create another folder for your additional material. Example images, font files, CSS files,videos and lot more. Name the folder asset. Then in asset, create a folder for keeping the images only, another for CSS files and another for font files.
Then you are done
Copy address from the first folder created( this is easier)
Now you provided screenshots, I can try to help better. In the folder tree, you can see folder named Portfolio and folder named Images are on same level. Because of this, when you are inside of folder Portfolio, you should navigate one level up.
Please try to use
<img src="../images/profile-pic.jpg">
I have an Angular Application with the following structure:
Structure
As you can see, there is a backend directory (yellow marked) in which other directories exist, such that the following path is valid: backend/uploads/users/user123/unnamed.jpg.
Now I want to use that image in my app.component.html
<img src="">
I tried to put the path in the src-property in different ways but the image is not appearing. How would the src has to look like to use that image in my Angular project?
I guess you are using the angular CLI. Therefore you should put the image in the assets folder. Try again than and it will work.
Like this:
<img src="/assets/images/unnamed.jpg">
EDIT: I am sorry, did miss out that part. You need to edit the angular.json file for this. Add the path of the backup folder there to the assets. But the backup folder must be in the src folder for this to work. Thats my suggestion for a solution.
So you will be adding "src/backup"
I don't think what you want to do is actually feasible. if you want to use an image in an Angular app, it's either an asset and you put it in the assets folder, or it's a resource coming from your backend and you will have to write a proper mechanism to expose the wanted resource, and then use it in your Angular app.
I have a create-react-app project in which I want to link to a pdf file I have saved in my project. I suppose my questions are twofold:
1) I'm not sure where exactly I need to save the PDF file (src folder vs public folder)
2) How do I properly link to the pdf file? Right now I have something like this:
Resume
and it's not displaying - it changes the URL but doesn't take you to the PDF.
Any advice greatly appreciated!
You need to have the file in the public folder. If you want it to open in a browser, that's what it will do. If you want to force users to download, you can add the 'download' attribute to the anchor tag.
Place the file somewhere in src/, for example src/static/my-file.pdf.
Import the file at the top of your component, like import myFile from "./static/my-file.pdf"; (path is relative to src/).
Reference the object in your a tag: <a href={myFile}>Link to My File</a>
I had this issue in two different areas of my project, in the App component in the src folder and in a link from a child Navigation component. I created a 'docs' folder in the src directory and used require syntax to link to my file and it worked for me.
In the instance of the navigation component I accessed the file by changing the directory up two levels.
<Link href={require("../../docs/FILE_NAME.PDF")} target="blank">
Resume
<Link>
In the instance of the App component I searched in the same directory.
<Link href={require("./docs/FILE_NAME.PDF")} target="blank">
Resume
</Link>
Adding "download" helped me using Create React App
<a
href="/pdfname.pdf"
download
>
Download Resume
</a>
pdf location:
in public folder
I currently have an index.html which doesn't have much in it and want to access the app.html which is in a subfolder from index.html as shown here.
My other html file is in app. In addition how do I reference that page in say a button on my index file?
Your app.html is located here: app/app.html
Try linking to it like so:
App
I'm making a simple chat app with meteor. My HTML is:
<body>
<h1 align="center">tomomi-chat</h1>
<img src="original.gif">
<div class="container" align="center">
{{>entryfield}}
</div>
<br>
<div class="container">
{{>messages}}
</div>
The image won't load on the local server. As the app is extremely simplistic, there are no folders besides the '.meteor' folder in the directory. The .js, .css, and .html files are all in the app directory.
Even if I host the image and use an external link, the result in the same. Why is meteor blocking images from my app?
deployed: http://tomomi.meteor.com/
You should create a folder named public in your application root folder.
From the Meteor documentation:
/public
Files in /public are served to the client as-is. Use this to
store assets such as images. For example, if you have an image located
at /public/background.png, you can include it in your HTML with or in your CSS with background-image:
url(/background.png). Note that /public is not part of the image URL.
To elaborate on this, I would add images asset directory in the public folder like this and serve it via like this
images/transparent.jpg
Create a /public folder. put your images there.
Put assets in PROJECT/public folder and when you specify link in tag, just use "xyz.jpg".
Thats it! The URL does not include /public folder in it. It is very very taken correctly by meteor framework.
CORRECT -> "xyz.jpg"
INCORRECT -> "/public/xyz.jpg"
If you are Windows 10 user make public folder like that and call it in simple way