Solved

Append Javascript to URL, SET ZOOM

Posted on 2013-01-02
4
543 Views
Last Modified: 2013-01-03
Hello Experts,

 I got url for a web application to use it, how do I add to this url a JavaScript command to set ZOOM to be 120% ?

Thanks
0
Comment
Question by:madmare
  • 2
4 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 250 total points
ID: 38737525
You cannot run a command from the url.  You can pass parameters and the have the application process them off of the onload event if you have control of the code of the target page.  

If you could do it the way you described, it would allow sites to realy screw up others sites off of a link.

Cd&
0
 
LVL 16

Expert Comment

by:HagayMandel
ID: 38738358
This trick (with the help of jQyery) will do it

$(document).ready(function() {
		//alert();
		var url = window.location.href;
		var zoom = url.split("?");
		if((zoom[zoom.length - 1]) == 'zoom120'){
		$("body").css("zoom","120%");
		}		
	});

Open in new window


Just add 'zoom120' to the end of the url
0
 

Author Comment

by:madmare
ID: 38739145
Hello Hagay,

 I don't have any permission to insert code to the url page,

 for example the url is http://www.yahoo.com & I want to add some code to this url to be opened in ZOOM 120%

Thanks
0
 
LVL 16

Assisted Solution

by:HagayMandel
HagayMandel earned 250 total points
ID: 38739192
url by itself is only directive. The referred page (provided that it contains some code in it), can parse it and do thing accordingly.
If you don't have an access to the page content, or you cannot manipulate the link to the url, nothing can't be done.

As said, the page must contain code (as in my previous answer), and the link must be something like:
<a href="www.yahoo.com?zoom120">Yahoo</a>.

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Technology Resume 7 69
Rotate images for Web Page 11 28
Read text on Table 7 29
How do I Import CSV File In my PHP Application 29 18
Find out what you should include to make the best professional email signature for your organization.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question