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 3 years ago.
Improve this question
For a while now, i want to create an autoclicker for in the browser to click on specific buttons on a website. Since i am pretty familiar with javascript i want to use javascript to write the script. To clarify what i want, imagine a website with a list of items. Each of these items has a button with the content "add" and contains the css class "add-btn". What i want is a script that scans the code of the wanted website and searches for all buttons with the "add-btn" class attached to it. Then i want to trigger the click event for each of these buttons one by one. (If it is possible i want the browser minified and not opened while running the script).
I already did a lot of research on the internet and still haven't found a clear javascript tutorial to achieve my goal. Does anyone maybe have a link to a tutorial that matches my wishes? Or maybe a push in the right direction?
What you want is a headless browser, like PhantomJS or Zombie. PhantomJS is no longer maintained. Then you can navigate to the page and find buttons using css selectors, which you can then trigger click events on.
https://phantomjs.org/
http://zombie.js.org/
Related
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 5 years ago.
Improve this question
I have a lot JS files in legacy project. Some JS code is blocking form submit, how I can find what JS events is listening form submit ?
Chrome actually has a great tool that is able to do this. Right-click on the submit button and open dev tools. Then go to event listeners in the sub tab from there you should be able to see the submit action. You can expand the action and view the source.
the comments are a good start, additionally search through all files for any reference to the forms name or id and if thats not enout for any code looping through all forms.
depending on the techniques used, e.g. jquery you might need to change your search like
document.getElementsByTagName("form")
$("form")
$("#ID_OF_FORM).submit
and so on... i guess best chances by using the ID of the form
You can also add event listener in Console Tab.
More in article below.
How to debug Front-end: Console
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
I have a landing page with a list of articles. Users can open every article in a modal window. The problem is that in this way I don't have a possibility to share a link for a specific article. I am trying to find a solution similar to how facebooks newsfeed is working- when you open a picture in the newsfeed, the link is changing and you can copy this link and share it with anybody else.
My website is made on django (python) and it's using bootstrap for modal. I heard that the solution can be in using a JS framework like Angular or similar. Unfortunately I am not so familiarized with JavaScript. What solutions can I find for this issue?
Why don't you just make a separate page displaying individual articles? I know that you already had the modal but by sharing the url that displays the individual page url people could read what's being shared without other useless contents and also make your life easier. The unique identifier could be the article id or a slug.
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
So I have an app user can create a tag, and choose a tag to post their stories. Everything works fine, but I want to change the way user choosing a tag to post stories. Right now, user has to scroll through the tag they want(more tags created, more scrolls user has to do)
What I'm trying to do is to display, some main tags I make to be inside box and user to be able click the tag that the tag to be chosen. It would be nice to make a search engine that user can type and the tag to be shown up that user can pick....but this seems too advanced for me now. (if you know how, please let me know)
the above is what I hope mine to be replaced to.
I'm not even sure which code I should touch to make this happen.
views.py?forms.py? or is this javascript?html file?
I think you are searching for Select2, there is a django package called django-select2
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 7 years ago.
Improve this question
I've got a setup of HTML, PHP & jQuery. The steps I want the user to take are as follows:
Click a button
Modal Appears with dynamic data (taken from button markup, parent div etc.)
User Submits Modal & Close
I have two options. To:
Generate the HTML prior the user clicking the button. With PHP & Just hide it & then manipulate it with jquery once clicked.
Request the the HTML on click via Ajax using an API & again manipulate it with jQuery.
My question is. From the two options which would be the best for performance?
Reading through this and documenting my logic. I'd say that point 1. would be best as I'm not requesting a large amount of data through the API every time?
Can anyone see any advantages to number two? Apart from not requesting the data server side on page load?
Thanks.
I think the main question here is "how dynamic is the information used to produce that HTML ?".
If there isn't any high probability that the information used to produce that HTML could change at any time, then you should better off with 1st option, since therefore you will be avoiding an additional request to the server.
If the information used to produce that HTML could change at any time, that would be the reason to use the 2nd approach.
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
I have just started using JQueryMobile and built a little app.
This app has one page with a table that i build dynamically using javascript.
This table is being built at the app load and each 10 seconds.
After the table is build with all the rows and other stuff , i add it to a div (data-role=page).
On the first time i use $.mobile.changePage("#WantedPage") , it works fine and has the css design.
But, if i stay one this page and the method of the dynamic build of the table is called it looses all of its design it had before.
I tried already to reload the page also after building this table but it still has the same problem.
Can anyone give me a direction with this issue?
I will be glad to give more info if needed.
Edit:
Each td in the table has a button inside it and i noticed recently that before the re-build of the table with new button , it creates a div that has a span and button in it.
and after the re-build , i have only a button in it.
Just trigger this line after you add dynamic content:
$( ".selector" ).table( "rebuild" );
First time it works because you are adding it to other page. Secone page is not enhanced because it was never active before. As soon as you transit to it jQuery will enhance full page markup, including dynamically added table.
But, when page becomes active, if you add dynamic content, you will need to enhance it manually.
There's another function that can help you, but in this case trigger it on whole page:
$('#pageId').triggerWithin();
On there other hand, if you want to find more about this topic read another related answer.
Working example: http://jsfiddle.net/Gajotres/vds2U/85/