Opening onclick events python requests library [closed] - javascript

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.

Related

Calculate index of character in google doc, on 100th page, Same as how SAVE API call does [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 2 years ago.
Improve this question
I have really struggled a lot on this problem. I want to find the character index in google docs which have 150 pages.
What I want:
exact character index of on the page text click,
Reference: What i saw Save API, gets that information somehow, you can check by following the below steps.
go to page 100th in a google document by scrolling.
open debugger and check SAVE API call after editing in the document.
Check the request body "ibi" property will give you the exact index.
I want to get that index on page text click.
Currently, It is not possible for apps script to capture client side DOM events. Also, there is nothing in the official documentation about capturing selection from document. Though selection capture is possible both in Sheets and Slides.

how to find or decrypt the url of javascript:void(0) [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
well, I just downloaded a code from internet and it has
login
when i click on it, it shows a pop up.
I want to use that pop on any other button , but does no know how to do that. can any one please explain me how it can be done or how the current given line is working.
I am just new to this, so please dont be mad if it is a stupid question.
Thank you
javascript:void(0) returns undefined, so the link does not actually lead to anywhere when clicked and the normal <a> element behavior is suppressed. That means there's a click handler set up on the element that handles showing the popup. This click handler is found somewhere else in the code.
I'm assuming that the click handler is associated with the action class, so if you attached class="action" to another element, you'll probably see the popup.
To create "pop ups" (actually known as alerts), you use the following code:
alert(yourStringMessageHere);
The javascript: part of the code you are showing simply tells the HTML parser that when the hyperlink is clicked, the following JavaScript should be executed. void(0) is asking for the expression 0 to be evaluated and since 0 is another way of expressing false, the expression essentially winds up causing nothing to happen, which when added to a hyperlink's href attribute is sometimes desirable. This code does not cause a pop up to appear. If you are getting one, it is because of something else.
Lastly, including JavaScript into html in this way is strongly discouraged as it is bad form and can lead to code that is difficult to read and maintain. JavaScript should be separated from HTML.

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.

HTML, JavaScript [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Help needed to understand the source code...
I visited the website bseindia.com some time ago and when i was checking for its coding i couldn't understand the action performed when you click on the buttons aligned horizontally at the top (About BSE, Markets, etc). The anchor have href attribute with value only "#". I could use something like that in my upcoming project so i would appreciate some help.
please tell the use of empty "#" in anchor tags href does and if any other language like Server-side etc then please do tell me.
This is a common practice. Actually these kind of links are used more like "buttons". I mean, the url will not change, but some action will happen, based on the javascript implementation.
Please read this post, to learn more: Which "href" value should I use for JavaScript links, "#" or "javascript:void(0)"?
please tell the use of empty "#" in anchor tags
It is a relative URL to the top of the current page.
If anything else happens when the link is clicked, it is because client-side JavaScript is involved.
Binding JS to links to the top of the page is a common practise, but a poor one. It is neither Progressive nor Unobtrusive.
The # is to keep the styling of the link (I think that is what it is for, not sure). An action takes place because javascript registers event handlers on the link, such as this:
html:
test
javascript:
document.getElementById('test').onclick=function(){
alert('you clicked it!');
}
here is a jsfiddle: http://jsfiddle.net/fZ2JQ/

asp.net mvc a grid of results with close buttons [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 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.

Categories