asp.net mvc a grid of results with close buttons [closed] - javascript

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Currently converting an old asp.net web forms page into a asp.net mvc version, and a little stuck on something that isn't a major deal, but would be a nice to have.
When the user logs in, they are taken to a messages page at /Alerts. They can close individual messages by clicking the x's, and then if they close all the message they are moved onto another page automatically.
The original site did postbacks, so the URL stayed the same. In my new version, I planned to make the x button a link, that went to /Alerts/Confirm/xx where xx is the id. The problem is, after processing, the address bar stays on that url, whereas I'd like to leave it on /Alerts
The four solutions appear to be either:
1) using AJAX to do the processing;
2) a redirect back to /Alerts after processing;
3) replacing all the X links with a submit button, and using javascript to pass a different ID depending on which message is being acknowledged, so that I can change the Confirm method to an HttpPost-accepting Index method?
4) URL Rewrites? (not sure about this, just thought of as I wrote this)
Or am I missing something obvious that would do what I'm trying to achieve?

I agree with #1 and use Jquery to do it.
Or you could show/hide those messages using Jquery .show() .hide(). So, they would always be there, just hidden. When they hit refresh they would show again.

You can also use some sort of notification plugin for jquery, there are many available just google for it, this page has about 6 examples, it is a bit old but you can get an idea.

Related

Opening onclick events python requests library [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Tried to get links to all issues of a publication for a given year, from this link: http://www.vetsci.org/journal/list.html?pn=vol&year=2018.
E.g: "Jan. Vol. 19 No.1. 1~160", which has an 'onclick' event.
edited
I would appreciate any help with how to do the following:
first, activate the onclick event;
second, get the link of the page to which the onclick event is leading the browser -> I have used the developer tools after clicking, to see the link of the new page. However, since this is no different to manually clicking and copy/pasting the url, I would like to know if there is a way to automatically read these links.
edited
Hope I am not spamming, since there are a couple of other threads on issues with getting popups and similar, but those seem like somewhat advanced stuff - at least from where I am standing :)
If you want to activate the event itself in any situation, you'll need something like Selenium. If you want to retrieve the page in the example you gave, inspection of the code shows that the onClick event loads the list.html page with parameters like so:
http://www.vetsci.org/journal/list.html?s_v={volume}&s_n={number}&sort=start_Page*1&TG=&pn=vol&year=2018&sm={4th argument}
I can't quite tell what the 4th argument is supposed to be because it's blank in all the examples you gave. If you do a GET request on that URL, you can use something like BeautifulSoup to parse the page.

Exchange Html Data form in Real Time [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
hey guys I'm totally new to programing and I need your help to walk me through this .
lets say we have 2 users that want to communicate through HTML forms
The first users fills out a html form ( first name , last name , age etc ... ) and submits it .
The second user receives the form without being able to apply any modifications to it and then submits back to the first user as either approved or disapproved ( by ticking a radio button )
all of this has to happen in Real Time.
can somebody please explain to me how it works ? Is it done with Ajax ?
what should i research ?
You should look into Web Sockets, this is how you can accomplish the functionality you would like. Here is a link to some information on web sockets and it has a few different libraries that implement and abstract web socket to make it easier to use:
https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API
If you develop in Visual Studio with .NET, then you can check out Microsoft's SignalR library. It makes WebSocket coding easy:
http://www.asp.net/signalr
If you are wanting to stay away from WebSockets completely, then you would be looking to use AJAX and "Long Polling". here is a good SO post on this:
how does long polling work javascript?

boostrap hide/show buttons based on variable [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm (trying) to build an app based on boostrap/javascript/ and a nosql DB
a sort of small CRM/invoicing system
i need to show/hide button based on variable
for example for a quote, status could be "open", "lost" "win"
so on my quote details page when status of quote is open i want to show button
- win (who change status of quote id in db to win and copy quote to an order)
- lost (who change status of quote id in db)
but i want to hide button "Re-open" who change a cancel status to open
and so on for my different status..
so want i'm looking for is a way to collapse/hide some button depending of the status of my quote (i put the status of my quote in a variable called quoteStatus)
any suggestion will be welcome
thanks
jeebee
You can do something like that
if (quoteStatus==="value"){
document.getElementById("buttonId").style.display='none';
}
else{
document.getElementById("button").style.display='block';
}
this is just javascript, you could use jquery it will make it easier for you, so your code may look like that
if (quoteStatus==="value"){
$("#buttonId").hide();
}
else{
$("#buttonId").show();
}
To get more positive reactions to your question you have to show some research effort. This question is not useful in that mather that you havent actually showed us what you have tried, and the purpose of your functionality have possibly been asked and explained before? How to hide/show div based on variable using javascript. A div and a button is both elements.
Either way, as for your question, we need to know what you already have. The task in itself have several ways to be accomplished, and based on your existing code there could be a way to complete this task in a more correct manner than others.

OS X login page like HTML [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I know the Title is a little obscure, but I will try to explain my best. Since OS X Lion the login screen of the Macs presents a row of images of the available users. Once you click one of those images, the rest disappear, centering the clicked one and revealing a password field.
I want to do a similar thing in a web-app. I have a few users, and I want them to click on their image to reveal the password field.
I searched for similar options, but can't find anything, and I don't even know how to proceed. I guess JQuery or Javascript would be necessary, but those I know little to nothing (HTML & CSS shouldn't be a problem, but well, I don't even know how to start this simple thing... )
Thanks!
Google is your friend... no matter how much the NSA are watching. Use it to search for tutorials, these are the best way to learn. Mostly CSS will be needed to make it look like the OSX login screen... maybe a bit of jQuery.
Within in seconds I found this page of many examples of login forms. And then I found this one that looks very similar to an OSX login page.

SEO - duplicate content with Javascript slide deck [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I have a slider which works like this:
When sliding to an item the URL changes using the HTML5 History API
If a user enters an item's URL (e.g. "/slide-5") directly the slider shows the respective slide.
The navigation of the slider consists of <a>-elements with their respective href-attribute (e.g. href="slide-5").
This works fine and even with JavaScript disabled the user can see every slide's content.
My question is: A search engine is going to crawl all links. But basically all this URLs are have the same content. Can this have negative effect on the page rank? And if so, what would be the best solution to this problem?
If this indeed effects the page rank, would this be a valid solution:
Only the requested slide's content is on the page.
The content of the next requested slide is loaded via XHR.
For current visitors: This post from 2012 is very old now. At this time the History API didn't have a good browser support and it wasn't really clear how search engine handle JavaScript. This has changed drastically in the last years and you can find sources to cover the topic at hand. Still, this is very opinion based.
It might affect your SEO.. It might not. But to be sure; have a look at Canonicalization.
http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139066#2

Categories