I was wondering if there is a code I can enter in a URL to alter a website. The website has images and start a preview when you hover over the image with the cursor. So my question is can you send java script code in the URL to hover over all images to make all images show previews at the same time?
I noticed this code for their mouse over
onmouseover="startThumbChange(7901031, '49992710857901031', 16,
'http://thumb1.cdn1a.image.websitename.com/videos/201212/06/7901031/240x180/');"
onmouseout="endThumbChange('49992710857901031');" />
or is this not possible?
(meaning it will only work if injecting java script with each image specifically?)
im guessing something like this
javascript:document.getElementsByTagName("img") or
javascript:document.srartThumbChange(document.getElementsByTagName("img"))
need help coding, not too familiar with javascript
It's certainly possible!
Using document.getElementsByTagName("img") you can loop over all images. You then need to check whether the mouseover attribute contains startThumbChange and then use JavaScript eval for example to run that function. You can run your complete code by putting it on one line and add javascript: before it, then paste it in your browser bar. Let me know if you need any more help!
Update with example code:
var imgs = document.getElementsByTagName("img");
for(var i=0;i<imgs.length;i++) {
imgs[i].onmouseover();
}
And to paste in your browser:
javascript:var imgs=document.getElementsByTagName("img");for(var i=0;i<imgs.length;i++) {imgs[i].onmouseover();}
JSFiddle: http://jsfiddle.net/h6ZS3/1/
Another update with a fix for the specified website
I'm not sure why, but it seems on some websites the onmouseover can only be read as an attribute while on others only as an event. Perhaps someone else can shine some light on that, but at least this works for your goal :)
javascript:var imgs=document.getElementsByTagName("img");for(var i=0;i<imgs.length;i++) {eval(imgs[i].getAttribute("onmouseover"))}
Related
I have encountered one little problem. I have no idea how to harvest data from website that are result of some function or something. I know only Java, no idea how this other stuff works so idk how, or even if is it possible.
Thing is, this one website don't show text I'm interested in as text but rather take that text and put it into image as .png.
I would like to save this image or do something with it but I don't know how to save/access/take/work_with/point_bot_on it since it is not stored there as image but as some action.
This is problematic line:
<img src="https://www.example.com/create-image.php?width=290&text=sufPX6l9UqgWD9nYUKgofAoj1sIkTrOoniENZWApbZ0=" alt="">
See that "/create-image.php"? Is there way I could still get that image, considering I'm using Jsoup? Or perhaps, decipher/de-hash/de-something text part?
I've tried various online tools to try to make that text part text but without result.
And I have tried to get that img by just copying URL and then tried to visit it and get it from there, not original website ...as well without result.
When I move cursor over that line in browser's inspector I see this image but I'm not into doing it manually :D :)
I would like to ask, how would you get to this image?
Thanks :))
Let me explain myself as my question title may be a tad random. My website has a good few images, as such I want to have say a loading bar that as my browser receives and image it moves the bar x pixels to the right. Now the css behind it all isn't to bad. The problem I'm having is with JavaScript how one would determine when the how image has been obtained in the browser? So when all the images have loaded I can simply just show a neat page with out the user seeing all these images slowly download on their screen. Something similar to the following site:
Link
Or even I'm completely wrong here? How is the above link achieving this? Any tutorials would be a great help. As I tried googling "HTML Loading pages" This really is my first time doing this ever.
If you are using jQuery then please use load event on image selector like
$(function(){
$("#image").bind("load", function(E){
alert("Load");
});
});
Or you can also use onload JavaScript event
document.getElementById('image').onload = function(){alert("Load");}
I wanna show some text (and images) in browser but this text shouldn't be able to select in page preview or page source :
At first i tried to use canvas, but managing text and also images in canvas is not easy and for this case i can't use canvas.
I tried to use image but in this case, image is too slow to load.
I used ROT13 encryption in Aptana studio, but ROT13 just encrypt page source with JS and when you click on 'inspect element' in chrome or opera you can see decrypt text and html yet.
Question: Is there any way in jquery or anything else?
No, whatever you display as text in webpage can be found by digging into the source of the webpage (including js). What would this be useful for btw.?
Edit: This looks useful but ends up using canvas or flash I believe. Still might be tuned to be fairly fast and therefor useful:
http://eric-blue.com/2010/01/03/how-to-create-your-own-personal-document-viewer-like-scribd-or-google-books/
You most likely won't find a way to do this easily, as when the browser downloads the page, in order to show the text to the user it has to be decoded or decrypted. So no matter what, if the user can see it, they can copy it. If all you want is to block selection in the browser, this answer should help
No, if you want to place something on the page a browser need to know what you want to place on the page. And everything what was sent to the browser is readable for a user. So you cannot do this.
The answer is very simple: If you don't want to publish something don't place it on the internet.
yes, this my logic check out
make you string in ascii code and write on document
check below link and find example may you help
Link W3School
I guess no one could do that.
Just use some image instead, old-style, but useful.
Hi i'm a JavaScript novice and need some help. I am trying to create a toolbar which can be viewed on any website through the use of a bookmarklet, the toolbar is simply just a div with a few links. But i am stuck on how to achieve this. Any help to accomplish this would be greatly appreciated.
most bookmarklets that do something complecated like "creating a toolbar" simply add an external script to the page that the bookmarklet is invoked on.
Basically all you have to do is write a link that contains javascript, which can be acheived by starting the href="" with javascript:
so lets just start with a script in an href that will add an external JavaScript to your page
addScript = function ( url ) {
myScript = document.createElement('script');
myScript.src = "url";
document.head.appendChild(myScript);
};
addScript("http://google.com/");
so if you shrink that down into a url you get..
click to add toolbar
however you want to make this bookmark-able so theres one more level of confusion we have to add... and this part has to be done in different ways depending on the browser
addBookmark( url, title ) {
if (window.sidebar) { // Firefox
window.sidebar.addPanel(url,bookmarkName,"");
} else if(window.external) { // IE
window.external.AddFavorite(url,bookmarkName);
}
}
You can include that on the page where you're going to have your add bookmark button. A couple things to note though
this isnt going to work in opera.. but who cares about opera
webkit browsers (chrome & safari) dont allow javascript to create bookmarklets
Finally you need to mash it all up into one ugly link
click to add bookmark
In the end though I suggest you look into making a Google Chrome Extension or a Firefox Plugin instead of a bookmarklet since you have more capability with either of the two.
As far as how to make a toolbar with JavaScript, well you're just going to have to make another question for that.. Its too much and you haven said enough about what you wan to do for me to answer it here.
bombedmetor,
Greg Guida's tip on including an external script will allow you to create an awesome, clean bookmarklet-based toolbar. Why? Because you'll be able to use JavaScript libraries like JQuery, etc.
Here's a quick example along the lines you asked for to help get you started. The bookmarklet creates a div element with a link to the Stack Overflow homepage.
javascript:void(function(){var divElmt=document.createElement('div');link1=document.createElement('a'); link1.href='http://stackoverflow.com';link1.innerHTML='StackOverflow Homepage';divElmt.style.backgroundColor='yellow';divElmt.style.position='fixed';divElmt.style.top='0px';divElmt.style.width='10em';divElmt.style.height='5em'; divElmt.style.border='solid red 4px';divElmt.style.zIndex='100'; divElmt.appendChild(link1);document.body.appendChild(divElmt);})();
To use the above bookmarklet, you create a new bookmark in your favorite browser and add the code above where you would normally place the URL.
The code does the following:
Creates a new div element.
Creates a new anchor element and sets the value of the href attribute.
Assigns some basic values to the style attributes of the new div (so you can see it easily).
Appends the anchor as a child element of the new div.
Appends the new div element as a child of the body element.
If all goes well, you should see a yellow box with a link to the Stack Overflow homepage at the top-right of your page after using the bookmarklet. bombedmetor - I hope this helps get you started. After you get comfortable with how these things work, you can apply Greg's wisdom to create your toolbar bookmarklet in a way that can be added to people's browsers with just a click or two.
Something to keep in mind: As Greg indicates, bookmarklet code is treated as the contents of the href attribute of an anchor element. This is why I used single quotes in the code above.
Some sites/articles to check out:
http://en.wikipedia.org/wiki/Bookmarklets
http://www.latentmotion.com/how-to-create-a-jquery-bookmarklet/
Quite simply, I have a SWF embedded in an HTML web page and want to move to a specific frame when a trigger is clicked.
But nothing happens when I click the trigger, as though the js just doesnt communicate at all with the swf.
SWF is written in flash cs4 (a3)
The link to the website is http://simplywebdzine.com/test.html.
I have read the text books over and over and researched high and wide on the internet and as far as I see I have done everything correctly but I cannot get this to work.
The swf is very basic, just a green box moving accross a small stage.
The desired gotoframe would make it cross at a lower height (just a dry run for a more complicated swf)
Would really appreciate someones help if you could possibly find out from the source code what is going wrong.
Many thanks
Steve
It looks to me like you have two problems.
You do not have the correct id for your <object> according to your javascript. The object id is "mymovi.swf" while your javascript is targeting "mymovi" as the id.
Even if I change your id using firebug, the function still does not fire off in the flash and I get an error about the function not existing.
Have you added a callback method in flash? something like flash.external.ExternalInterface.addCallback("GotoFrame", gotoFrameHandler) ??