Where is the error in tag(a)? - xhtml-1.0-strict

this is my first year in html courses, i'm using HTML 4.01 Strict/XHTML 1.1
Where is the error in this code??
<a href="http://www.upv.es" onclick="target='_blank';">
<img src="http://politube.upv.es/templates/imagenes_cabecera/escudo.gif"/>
</a>

Well, you don't provide us with information about what you expect and what is not working. If you try to open the link in a new Tab, you'll have to change
onclick="target='_blank';"
to
target="_blank"
Otherwise, you'll be just setting a JavaScript variable target to the string value _blank.

Related

Add2Any print preview instead of print

I use AddToAny plugin to a Joomla website. I need to replace the code so I can "preview page" instead of "print" (ctrl+p).
I found AddToAny files into /plugins/content/addtoany, but I see no code for print service code
There is no code in the plugin for links generation, unless if you're talking about the css class to add a specific link (see below).
All the links are generated via the AddToAny's js: http://static.addtoany.com/menu/page.js
As you probably already know, all the rendering is generated with classes (powered by the js file above): https://www.addtoany.com/buttons/customize/standalone_services
<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
<a class="a2a_button_facebook"></a>
<a class="a2a_button_twitter"></a>
<a class="a2a_button_google_plus"></a>
<a class="a2a_button_pinterest"></a>
<a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>
<script type="text/javascript" src="//static.addtoany.com/menu/page.js"></script>
This means the links themselves are not "generated" in the plugin, so your solutions are whether try to override the plugin via the MVC override plugin or develop your own solution.

Kentico 7 create content placeholder in Portal Master to use in ASCX in inherited page

Working in Kentico 7 on an Ad-Hoc page that inherits from Portal Master. I want to insert some literal script or code right before the </body> tag in the rendered ad-hoc page.
I thought I'd have to do this by editing the portal master and adding the following:
<cms:CMSPagePlaceholder ID="plcBodyEnd" runat="server">
<LayoutTemplate>
</LayoutTemplate>
</cms:CMSPagePlaceholder>
and then in the layout of the Ad-Hoc page do this:
<cms:CMSContent runat="server" id="cntLeft" PagePlaceholderID="plcBodyEnd">
<script type="text/javascript">
ProviderConnections.Transparency.initializeWidget({ });
</script>
</cms:CMSContent>
This worked fine until I went to the design tab on the Ad-Hoc page, where I got the following error:
Object reference not set to an instance of an object.
I don't want to register script blocks. I just want to put text in the Ad-Hoc page that goes there before the </body> tag, which is controlled by Portal Master.
What am I doing wrong?
I'm not 100% sure what you are trying to achieve. Giving an example or attaching a screenshot would be very helpful.
Here are the ways of attaching JavaScript in Kentico:
Through portal engine:
Use JavaScript web part - that gives you an option of choosing where the script should be located
Programmatically from code-behind:
Use CMS.Helpers.ScriptHelper API (wrapper around ASP.NET's ClientScriptManager)
ScriptHelper.RegisterStartupScript() to put the script at the end of the page
ScriptHelper.RegisterClientScriptBlock() to put the script before page's elements
The difference between the two is well explained here.
Programmatically from ASPX markup:
Put your <script> block to a desired location in your .aspx / .ascx files
Evaluate a code-behind variable containing script
<asp:Button ID="btnOK" runat="server" Text="OK" />
<script type="text/javascript">
<%= fieldWithActualScript %>
</script>

Facebook comments are duplicated on every page

I am trying to integrate facebook comments into my website (I tried to do it several months ago but there didn't seem much support about and I couldn't fathom it). The comments are showing and I managed to get the comment to show on my facebook wall under the individual post/item they were meant for but unfortunately it is posting the same comment under every post. You can see the box working here: http://www.roomfor5.co.uk/item/6726
The website is php based and the code I am using is: " title="" url="" width="600" publish="true" >
I have also used this code without success: " width="600" publish="true" >
I know it's something to do with the xid attribute but I am stumped as to why it is duplicating:(
Hi when looking at the view source of your page I see this:
<fb:comments
xid="http://www.roomfor5.co.uk-<?=str_replace('/','-',$_SERVER['REQUEST_URI']);?>"
num_posts="2"
width="600"
publish="true" >
</fb:comments>
So the fb:comments tag is not getting rendered out fully.
Also on the rendered page, it says you haven't specified the url. while there is a malformed xid= attribute, you really should have a url= attribute. See https://developers.facebook.com/docs/reference/plugins/comments/
Warning: this comments plugin is operating in
compatibility mode, but has no posts yet.
Consider specifying an explicit 'href' as
suggested in the comments plugin documentation
to take advantage of all plugin features.
EDIT:
For http://www.roomfor5.co.uk/item/6726, you have
<div
class="fb-comments"
data-href="http://www.roomfor5.co.uk"
data-num-posts="5"
data-width="600">
</div>
The data-href attribute should be http://www.roomfor5.co.uk/item/6726 not http://www.roomfor5.co.uk
If you click 'View source' you'll see the rendered HTML:
<fb:comments xid="http://www.roomfor5.co.uk-<?=str_replace('/','-',$_SERVER['REQUEST_URI']);?>" num_posts="2" width="600" publish="true" >
It looks like you're trying to specify a unique xid for the page but the server-side script is behaving like plain text.

New fancybox 2, now all links give JS error Object #<HTMLHtmlElement> has no method 'show'

I updated fancybox2. Now all links on the website give a javascript error
Object # has no method 'show'
Even those links do not have anyfancybox attached.
Can someone explian me why or tell me how to fix it?
Thanks
you need to add the href tag on the link element for example:
<a class="fancybox" href="/path/to/original/image"><img src="/path/to/thumnail" /></a>

How can I redirect automatically to an other page of my WebApp

I am currently developing a Web App under jQTouch, and I want to know how I should proceed to redirect the user automatically to another page of my Web App.
For instance, let's suppose I have this code :
<div id="foo1">
...
</div>
<div id="foo2">
...
</div>
Now, let's suppose that the currently visible block is foo1. Which code should I write in my JavaScript file to redirect to block foo2 (as though I clicked a link with href="#foo2")?
Thanks and sorry for my English (I'm French).
You may use the jQT.goTo() to transfer to another page, e.g.
jQT.goTo('#foo2', 'slideup');
If you just want to trigger a click event on a link, you could use the click function in jQuery:
<a id="goToFoo2" href="#foo2">Go To Foo2</a>
<script>$("#goToFoo2").click()</script>
A standard link
Link
will not work, but you are on the right track, it just has to be in the correct setting (either a button, or a list). so either:
<ul class="rounded">
<li class="arrow">
Link
</li>
</ul>
or
<a class="button" href="#foo2">Link</a>
will work.