Click here to Skip to main content
13,051,502 members (55,722 online)
Rate this:
Please Sign up or sign in to vote.
<Hey all,
ive been trying to get my code to target and iframe and when it does so the iframe:
the iframe is currently

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:

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>',
'<a href="',r.unescapedUrl,'" target="window1">',r.visibleUrl,

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 19:13pm
Updated 3-Feb-12 19:14pm
Rate this: bad
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.
Jrop 5-Feb-12 0:52am
how would a achieve this?
sorry im not so good at Jquery im still learning,

$('a').click(function() {
Rate this: bad
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:

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 4 Feb 2012
Copyright © CodeProject, 1999-2017
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