JavaScript - Image In All Https Pages
Hi all,
I'd like to insert an image with fixed position in all https pages. Is it possible? How? Thank you very much Similar Tutorialsi have a script that measures the window size and - at this point - only adjusts the width of one css element. first function: Quote: var myWidth = 0, myHeight = 0; function getWindowSize() { if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } // window.alert( 'Width = ' + myWidth ); // window.alert( 'Height = ' + myHeight ); } second function: Quote: //changecss JavaScript Functions by Shawn Olson //Copyright 2006-2008 //http://www.shawnolson.net function changecss(theClass,element,value,sheet) { //Last Updated on October 10, 1020 //documentation for this script at //http://www.shawnolson.net/a/503/altering-css-class-attributes-with-javascript.html //ms: 5.5.11 added sheet: you have to point at the stylesheet by number var cssRules; var added = false; var mySheet = document.styleSheets[sheet]; if (mySheet['rules']) { cssRules = 'rules'; } else if (mySheet['cssRules']) { cssRules = 'cssRules'; } else { //no rules found... browser unknown } for (var R = 0; R < mySheet[cssRules].length; R++) { if (mySheet[cssRules][R].selectorText == theClass) { if(mySheet[cssRules][R].style[element]){ mySheet[cssRules][R].style[element] = value; added=true; break; } } } if(!added){ try{ mySheet.insertRule(theClass+' { '+element+': '+value+'; }',mySheet[cssRules].length); } catch(err){ try{mySheet.addRule(theClass,element+': '+value+';');}catch(err){} } } } i call the function in a php script that is to rule out that the server is talking to a mobile device, however, it echos javascript and a document ready function: Quote: $useragent=$_SERVER['HTTP_USER_AGENT']; if(preg_match('/android|...(non relevant code)...|zte\-/i',substr($useragent,0,4))) { echo '<link rel="stylesheet" type="text/css" href="1" />'; //the above never happens as i am testing on big screen } else { //echo '<link id="screensize" rel="stylesheet" type="text/css" href="stylesheet.php?cssid=47&mediatype=screen" />'; echo '<script type="text/javascript">'; echo '$(document).ready(function() { getWindowSize(); //ms: these variables come back: myWidth, myHeight if (myWidth >=1225) { changecss(".core-pageWidth","width","1225px",1); } else if (myWidth >1000) { myWidth=myWidth - 20; changecss(".core-pageWidth","width",myWidth+"px",1); } else if (myWidth >910) { myWidth=myWidth - 20; changecss(".core-pageWidth","width",myWidth+"px",1); } }); </script>'; } the changecss() does not work in https but works fine in http. is this to be expected? mario I can access the JS library at http://climbhigh.com/avmws_1011243.js, but not at https://climbhigh.com/avmws_1011243.js. I need to either make that library available via HTTPS, or provide the full path (http://climbhigh.com/avmws_1011243.js) when referencing the JS in my HTML code. The JS library is in the ssl and public_html directories, so it should be able to be accessed. When I manually provide the full path, it defaults back to: avmws_1011243.js. Maybe it's because I am not too familiar with JS but this issue seems simple, I just can't wrap my head around it. I am hoping someone with fresh eyes can take a look. Thanks! Hi, I am writing JavaScript code that runs inside HTTP page, I need to make XMLHttpRequest to a REST web service. The service is running on the same site but it only accepts HTTPS. I tried to prefix the URL with https:// and Firefox rejected it as cross-site scripting attempt. It's not really cross site as I am calling the same site. I don't have an option to redirect the entire page to https. Is there a proper way to implement this request? Sergey p.s. (sorry if this is a dumb question, I am a JavaScript newbie) i am getting security alert from microsot internet explorer. when i click on image icon,which will open a new window. message which i get is Do you want to view only the webpage content that was deliverd securely? This webpage contains content that will not be delivered using a secure HTTPS connection,which could compermise the security of the entire webpage. YES NO Actualy my application is on https//.... which will call http://... because of that i get this issue. i know i can bypass this with doing some settings in internet explorer. But my client wants me to do through java script coding so that they could not see this message at all. Please give suggestions. Thanks in Advance !! Hi, I coded the following JavaScript: Code: var el = document.createElement("iframe"); el.setAttribute('id', 'ifrm'); document.body.appendChild(el); el.setAttribute('height', 250); el.setAttribute('width', 300); el.setAttribute('frameborder', 0); el.setAttribute('marginheight', 0); el.setAttribute('marginwidth', 0) el.setAttribute('src', 'http://example.com/?pub=1&format=image&size=300x250&url='+window.location); And am putting it between <script type="text/javascript"> and </script> tags in the <body> section of my site. But, it only works in certain areas of the page. Can you guys think of any reason for this? Let me know... Thanks, ~Christian Hi, I hope someone can help me. I'll be honest and say I don't know much about javascript, but am fairly comfortable in html. I am building a website that will have multiple image swaps on multiple pages. I am building this in wordpress, and I'm guessing that means my approach will be different than if I wasn't using wordpress. Here's how one page would work: There are 10 images shown. 1,2,3,4,5,6,7,8,9,10. When number 1 is clicked on, I want a new image - 1a. When 2 is clicked on, 2a. So there are 20 different images in all on a given page. Also, I want the user to be able to click on the image again to restore the original image. I would prefer onclick to onmouseover. There will be literally dozens of pages like this on the site, managed by wordpress, so hundreds of images to swap. Basically the first image is a question - the second image is the answer. Is this possible? My website is https and I have both the http and https in my webmaster account and the http version is showing 150+ errors for one of the plugins but https version in Webmaster account does not show any. Do I need to worry about the http version since it redirects to the https?
Hi, I know lot of scripts written by experts in JS that extracts urls from source code placed into DIV or TEXTAREA, but I would need just one to extract the links ending by ".html" or ".htm" or ".txt". I would appreciate any helpful. Just he! how do i make something like this? so that instead of viewing a long list it will be divided into pages..? Hi, I'm in year 11 studying GCSE Computing and I'm working on gathering some primary research for a project. I'd be really grateful if someone with experience in web developing would be able to explain to me some of the uses of JavaScript within web pages- what have you used it for specifically? Also, any examples of how JavaScript is used outside of web pages would be really helpful. Thank you! Hi Forum, to develop a "Digital Signage" applikation we need: 1) After loading the (main) html page get all the pages (.html, .pdf, .xls, .jpg) as members of the paylist. - Is there a way to get the appr. 15 pages into the browser (as DOM Objects) ? Or rather to load in 15 iFrames ? 2) The mentionde pages should be displayed in a certain order (in ca. 20 sec tact). - A possible solution would be to hide / unhide. Any other wy ? Thanks in advance Michel How would you connect a HTML page wig a JavaScript page so a person could not reed JavaScript but it would still work.
I've been searching the net for a few hours now for a js that i can use <a href="http://www.sitename.com/#content/home">Home</a> load into a div, but i cant seem to find one, anyone got any ideas? or good links to any. Thanks. hi, im new to the html and javascript stuff and am coding my own site, and currently stuck. hope someone can help! for my website layout, i want to have 4-5 buttons on the left side for the different links, and on the right half i want to load that link without reloading the entire webpage. currently i have it so that everything is in tables, so table's left column contains the links (for example - Link1, Link2, Link3, Link4, Link5). now when i were to click any of those i want the page corresponding to that link to open up in the right column without reloading the entire page. i'm stuck on how to pass what i click on the left to load up on the right. any help would be nice! thanks I have the following snippet of HTML code: Quote: <table id="identificativo"> .......... .......... .......... <tr id="id_riga"> <td width="40%"> Cella 1 </td> <td> <input type="hidden" name="params" value="valore1 valore2" /> <input type="button" value="Add/Change" onclick="return del()" /> </td> <td> Cella3 </td> </tr> ............ ............ ............ and the following javascript code that replace the second row of table with new form: Quote: function del() { if (document.getElementById) { var tabella = document.getElementById("identificativo"); tabella.deleteRow(1); x = tabella.insertRow(1); x.innerHTML = "<td colspan='3'> \ <form action='/cgi-bin/save.cgi' method='POST'> \ <input type='text' name='name' size='30' /> \ <input type='submit' value='Save' /> \ </form> \ </td>"; } } How can to pass hidden values valore1 and valore2 from old cell of row to new form with javascript? Thank you in advance to answers, savio Hi guys, i have posted this problem yesterday but maybe it just wasnt clear enough on what i wanted to acheiv. basically i have 1 link throughout my site and its a "buy now" button. i want it to be able to fetch possibly a value out my page content and then depending on that content direct the user to the correct page when they click that button? is this feasible? cheers, ant. m using Jquery - isotope from http://isotope.metafizzy.co/ i noticed that the linking to a specific category is not possible since it filters using “data-filter” The links a PHP Code: <a href="#" data-filter="*" >all</a> <a href="#" data-filter=".logo" >logo</a> <a href="#" data-filter=".design" >design</a> i tried using linking like this below but it didn't work: PHP Code: <a href="portfolio.html#filter=logo" data-filter=".logo">logo</a> can anyone see if there’s a possibility to link to the “design” or "logo" category from another page? so that it would be already filtered when the user reaches the page. Hi, I want to redirect pages e,g 'http://mydomain.com/pagename.html' to 'http://www.mydomain.com/pagename.html",i.e if anyone access without www then it will be added automatically,how can i do this using javascript? plz help Thanks Good day Lets say I have a page with 3 thumbnails and one big div. When click in one of the thumbnails the image of it must appear inside the big div. Of course there are 3 images (little ones for the thumbnails) and 3 big images for the real size ones. Script this is simple for me but imposible if I have more than 100 pages within 6 images inside them (3 little and 3 real size for 3 thumnail divs and one single big div). There must be some kind of order to just script the divs of the thumbnail divs and the real size image div in all the pages at ones, otherwise I have to creat ID's to every single div inside every single page! (4 id's to one page and I have more than 100 pages!, this is inpractical because is posible that in the future the pics change, is more than 400 id's) For example: for FIRST.html big div (div id="img001bg") thumb1 div (div id="th_img001" thumb2 div (div id="th_img002" thumb3 div (div id="th_img003" SECOND.html THIRD.html ... HUNDRED.html ... ! There must be some solution using somehow the functions, please help! Thank you to all |