JS Fiddle & Dreamweaver - html

http://jsfiddle.net/amosrivera/AYWku/
When ever I try to implement this particular JS Fiddle into dreamweaver, the slide function on the button doesn't work at all. I have put the 'script' etc around the javascript code in the HTML document but still no avail. Any pointers with using JS fiddle?

Use Chrome to test and press F12 to see the console. If it says '$ is not a function' or so, you propably haven't got the jQuery library included. See here (http://docs.jquery.com/Main_Page) how to do it.
Alternatively you can use the plugin 'Firebug' in Firefox

Related

Chrome translator add DOM and breaks code

Chequear traducir correos-app se pifia
I have my app with a sidebar working ok, with this rendered code (the actual code is pure php and javascript, that's why I paste a screenshot of the chrome dev inspector):
and looks like this:
But when I use the Chrome Translator, it changes my code in DOM, it gets like:
And of course, it's rendered as:
Why happens that? any idea on how to avoid it? I need to use the translator. Thanks.

href javascript: generated by visual force page not working in firefox and IE

First: I know you should not use href javascript: to put javascript o a link. It is bad practise and all I can find on the forums is don't use it and questions regarding this are rejected. But I am not generating the html. It is salesforce who is generating html and I suppose they don't know better.
Now this is not working in Firefox and IE. Only in chrome. The strange thing is that if I try to write the same href in a test html page all 3 browsers seem to happily execute the javascript following the javascript: so it is not that is not supported by all browsers.
However with the visual force page embedded in the lightning interface such links no longer work. So I was wondering if there is anything I could investigate or do to get these working so any general information about why such links would not work or more specific why salesforce would be doing this for VF pages in the lightning interface could help me.
Such links are generated with the
<apex:outputLink target="_top" value="{!UpdateLink}">/apex:outputLink>
and to check that such links do not work when embedded in the lightning page I inserted the following snippet of html both in my VF page and in a blank html page
<script type="text/javascript">
function DebugClick ()
{
alert ('click');
return false;
}
</script>
debugger
In the html page it works in all three browsers. In the VF page it only works in chrome.
I also forced a break in the code and inspected the code using javascript to see if either the href attribute or the onclick of the link were changed but they seem intact. Here is my console output copy where I inspected the actual link not working, not my test link
window.getElementByIdCS('j_id0:j_id1:j_id2:updatelinkpnl').childNodes [0].onclick
null
window.getElementByIdCS('j_id0:j_id1:j_id2:updatelinkpnl').childNodes [0].attributes ['href']
href="javascript:srcUp('https%3A%2F%2Fbvdep.na5.visual.force.com%2Fapex%2FBvDAccountLink%3Faction%3DUpdate%26id%3D0017000001THUbxAAH%26objType%3DAccount%26product%3Dorbisneo%26isdtp%3Dp1');"
I finally cracked it (and see more or less where it is coming from) so here is for anyone encountering a similar issue what seem to be the key factors.
The is in an iframe. And the target is _top. I know this is a strange combinbination, but the original url was a simple link that needed the top target. It is only the lightning interface that substituted this to use javascript but doesn't remove the top.
Apparently IE and firefox then refuse to execute it. It might be that some security policy headers are part of the equation, but since I found a solution (make the target=_top dependant on the inteface I had no need to search further

How does iCloud.com hide its source code?

I know you can't hide HTML / Javascript / CSS because it's run on the client side, but how does iCloud.com hide its HTML?
When I view the page source on iCloud.com I just get presented with loads of Javascript, but when I go to inspect element in Chrome I can see the HTML.
I was just curious as to how they did this.
If you look closer at the page source you'll see this:
#noscript div#container{position:absolute;top:0;left:0;right:0;bottom:0;min-height:500px;}
#noscript div#overlay{position:absolute;top:0;left:0;right:0;bottom:0;min-width:600px;min-height:550px;background:#0B080E;opacity:.84;}
#noscript div#container div.float-center-canvas{z-index:101;position:absolute;background-image:url
....
It seems all the markup is generated in javascript and if javascript isn't enabled they run noscript. Not that anyone would be able to use iCloud without JavaScript in the first place...
All that javascript you see when viewing the source is responsible for generating the document that you can then inspect in developer tools once the page is loaded. Nothing is hidden; it's just that the document doesn't get generated until after the page is loaded.

Source code viewer through Html page

Hi im demonstrating the html tags that are new in CSS3 and I'm making a documentation for the easy viewing and interpretation on comparing both the source code and the output.And its its really hard for me going to the source code and then selecting the file and browsing it on the browser
It would be great if I could view both the source code and the output
on the same html page.
For example(I m talking from the page I ve attached below) if I select Source code the source code must be displayed on the screen or from any of the text editors.
I don't know whether it is possible to do so,If possible it would be great
if anyone of you could guide me.
To get the source of just one element, do this:
HTML: <div id="one"><span id="two"></span></div>
JS:
document.getElementById('one').innerHTML // returns <span id="two"></span>
document.getElementById('one').outerHTML // returns <div id="one"><span id="two"></span></div>
To get the source of the entire page, do this:
document.doctype + document.documentElement.outerHTML
document.doctype returns the doctype, and document.documentElement.outerHTML returns the code for the <html> tag and everything inside it.
Use the developer tools you have in all modern browsers (the most advanced ones being Chrome and Firefox).
You typically open such a toolset using the Ctrl-Uppercase-i shortcut.
Then you have a lot of useful tools, as described here for Chrome or here for Firefox.
One of them seems to be exactly what you need. For example in Chrome, the first tab, called "Elements", shows you the source code with a lot of goodies (interpreted css with reasons, element displayed when you hover the mouse, search, etc.).
I'd suggest you take the time to read the linked documentation, as this is an essential tool of any web developer. And you won't be able to stop using those tools as soon as you go deeper in javascript or css.

html select arrow look

In my html select element I would like to show a black arrow and no background.
How can I do it?
You can use a plugin for jQuery, I actually contributed to such a jQuery plugin and you can find the code on github.
The plugin allows you to cusomize the look and feel of the select boxes in your application, not just the arrow but the entire behavior can be customized.
Here's a link to the source code on github (forked)
http://github.com/KensoDev/Stylish-Select
This was tested in IE6,7,8 FF Chrome...
One way would be to use a background image for the select. However, it's not well supported. Personally, I wouldn't use a select for this.
See this for more info: http://doctype.com/styling-select-elements-backgrounds-etc
Here's an alternative method which may work: http://pennypacker.net/articles/css_tricks_select_menu