Question: How do i get jQuery to load once I click on the button. So far it loads when the page is loading. I want it to load after clicking the button! i tried a lot of things and they haven't worked so far please help...

this my code so far for it

```
<a href="#image_link" title="PutLockerMedia" id="click">watch</a>
<div style="display:none">
  <div id="image_link">
    <div class="imageWrapper">
      <div class="image"> 
    <iframe src="http://www.putlocker.com/embed/E25FA20CE8643E5F" width="600" height="360" frameborder="0" scrolling="no"></iframe>
      </div>
    </div>
  </div>
</div>

<script type="text/javascript">
   $(document).ready(function(){
      $("#click").fancybox({'scrolling': 'no','titleShow': false,'onClosed':
         function(){$("#login_error").hide();}});
   });
</script>

```

Answer: 
You need to make a function that recursively check the nested dictionary.

```
def exists(d, key):
    return isinstance(d, dict) and \
           (key in d or any(exists(d[k], key) for k in d))

```

Example:

```
>>> di = {
...     'resp': {
...         u'frame': {
...             'html': {
...                 'div': [
...                     u'test1'
...                 ]
...             }
...         }
...     }
... }
>>>
>>> exists(di, 'div')
True
>>> exists(di, 'html')
True
>>> exists(di, 'body')  # Not exist
False
>>> exists(di, 'test1') # Not a dictionary key.
False

```
Just trying to solve using regex, which is not the way to solve your problem. But this is fast .

```
#!/usr/bin/python

di = {
    'resp': {
        'frame': {
            'html': {
                'div': [
                    'test1'
                ]
            }
        }
    }
}

import re
def check(k):
    key = di.keys()
    string = str(di.values())
    if k in key:
        return True
    try:
        m = re.findall('({[\"\']%s[\"\'])' % k, string)[0]
        if m and re.match('{', m):
            return True
        else:
            return False
    except:
        return False

for i in ['resp', 'abc', 'frame', 'div', 'yopy', 'python', 'test1']:
    print i, check(i)

```

Output:

```
resp True
abc False
frame True
div True
yopy False
python False
test1 False

```