Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: HTML jQuery testing Target Link API , +
<Hey all,
ive been trying to get my code to target and iframe and when it does so the iframe:
$('iframe').show();
the iframe is currently
$('iframe').hide();
well the story is that im using google search API and I want the result(when clicked) to target my iframe:
<a href="',r.unescapedUrl,'" target="window1"> 
Now it DOES target the iframe, But when I:
$('a').click(function(){
$('iframe').show();
});
nothing happends?
it wont show my iframe?
 
the result page is coded with jquery:
case 'GwebSearch':
arr = [
 
'<div class="webResult">',
'<h2><a href="',r.unescapedUrl,'" target="window1">',r.title,'</a></h2>',
'<p>',r.content,'</p>',
'<a href="',r.unescapedUrl,'" target="window1">',r.visibleUrl,
'</a>',
'</div>',
 
];
is this effecting my code?
is there any way of writing a code to check if the iframe is being targeted?
 
any help will do, thanks
Posted 3-Feb-12 20:13pm
Jrop177
Edited 3-Feb-12 20:14pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I would put an alert in that click function to make sure it was being called, or use Chrome to put a breakpoint in the code, to see what was going on.
  Permalink  
Comments
Jrop at 5-Feb-12 0:52am
   
how would a achieve this?
sorry im not so good at Jquery im still learning,
 
$('a').click(function() {
alert
$('iframe').show();
});
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

use can use either Chrome or
built in debugger of Windows Explorer 7 or 8
or Firefox-Firebug or Visual Studio 2008/2010
 
<u>follow this steps....</u>
 
Visual Studio 2010 comes with debugger tool for javascript/ jquery. To enable Javascript debugger in Visual Studio, do the following:
 
Enable Script debugging in Internet Explore:
 
Click on Tools -> Internet Options -> Advanced tab -> Browsing.
Clear “Disable Script Debugging” check box.
Click ok and restart IE.
Using script debugging in Visual Studio 2010.
 
Write your script.
At beginning of your script add the below line:
debugger;
 
Run debug in Visual Studio, code will stop at “debugger” line and you can start debug from here.
From this point on, you can also set breakpoint on your script.
Good luck.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 7,800
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,790


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 4 Feb 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100