I am trying to navigate between two pages in angularJS using href. Both pages have accordions and they aren't loading properly when I navigate from one page to another. The accordion work fine when I refresh the page or when I directly go to the page (without navigating from another page).
Here is my code:
<a href= "{{domainName}}/#/Reports/Reports?subscriptionID={{subscription.SubscriptionID}}">
<div class="pull-right btn btn-xs btn-primary" id="btnEditSubscription">
<i class="fa fa-pencil" aria-hidden="true"></i> Edit Subscription
</div>
</a>
So I want to go to Reports page from this button click. Reports page has accordion. This is how the accordion in Reports page looks when navigating after the button click:
This is how the accordion should look like:
It looks like when navigating between pages I am missing .ui-accordion class.
Please help!!
Thank you
Related
I am using the code below to open a new tab upon clicking a bootstrap button in a razor .cshtml page currently. I have a button in the new tab opened which returns to the main menu, but I would like to know how to close this tab, to effectively return to where the user was previously.
<ul class="nav nav-sidebar">
<!-- Menu Item -->
<li class="menuItem">
<a asp-controller="New Tab Section Menu" asp-action="Index" target="_blank" class="menuItemLabel">
<i class="fas fa-book-reader fa-lg" style="padding-right: 5px"></i>
New Section Menu
</a>
</li>
You can't close browser tabs this simple.
I assume that you have a return button. What you can use target="_self" instead of target="_blank" so no tab will open and you can navigate back.
You could use window.close() in Javascript before, but this is mostly unavailable EXCEPT when you open a new tab with target="_blank" or by script.
In your case it might be worth a try.
Use a button with:
Return to base!
Browsers are very picky about this for security and useability reasons.
https://stackoverflow.com/a/66688958/6803592
Using link for open another page outside of project
<div class="info-line">
<mat-icon class="s-20 ml-2">
language
</mat-icon>
<a class="h3" href="https://www.google.kz/">
Web Page
</a>
</div>
but when click to link, opened this page: http://localhost:4200/google.kz - local page, not "google.kz"
How to make, open google.kz outsite link, not trying to find in local page?
You can use target="blank" as follows.
<a class="h3" href="https://www.google.kz/" target="_blank">
target
Where to display the linked URL, as the name for a browsing context (a tab, window, or iframe).
_blank: usually a new tab, but users can configure browsers to open a new window instead.
It should work the way you've described it, but another way of doing it is using the document.location api.
Example:
<div class="info-line">
<mat-icon class="s-20 ml-2">
language
</mat-icon>
<a class="h3" (click)="navigate()">
Web Page
</a>
</div>
inside your component:
navigate(){
document.location = "https://www.google.kz/"
}
I have the following code based others tutorials (look at the picture):
When I run the code through the browser, the button is appeared but when I click on it the pdf does not downloaded (or appeared to other html page).I have checked if there is any problem with the file link but when I run it through browser is appeared to browser properly. I must note that this code is included to php file ( for example file.php).CODE
HTML:
<button class="etc etc">
<i class="fa fa-download"></i>Katabaste Odygies
</button>
Try changing your anchor tag to look like this:
<button class="etc etc">
<a href="itdb/a.pdf">
<i class="fa fa-download"></i>Katabaste Odygies
</a>
</button>
When people click the <i> tag, it is not inside the <a> so the download is not being triggered.
Also, you are referencing the file incorrectly for a web server.
I'm using ASP.NET Boilerplate. I want to navigate to Home page when I click on Application logo. But I cannot find any method to change its click behavior.
topbar.component.html
<a class="navbar-brand" asp-controller="Home" asp-action="Index"><i class="fa fa-cubes"></i> Application Name</a>
I want a similar behavior like when you click on side menu items.
sidebar-nav.component.ts
new MenuItem(this.l("HomePage"), "", "home", "/app/home")
asp-controller and asp-action are Tag Helpers in ASP.NET Core.
For an Angular component, use the routerLink attribute:
<a routerLink="/app/home" class="navbar-brand"><i class="fa fa-cubes"></i> Application Name</a>
Do anyone know how to make a facebook share button with 2 actions ? similar like this , I got a html page with an IQ question ,when you click to share and link to answer pages .
Here are the question page look like :
Here is the code of share button:
<a class="btn-u btn-u-lg btn-block btn-u-dark-blue" href="###" target="_blank">
<i class="fa fa-facebook"></i> Facebook
</a>
Thanks for help