0

On my blog, I'm using a script that reveals anonymous messages as their normal username instead of anonymous. The script works fine on pages that I can make, but on pages that are default generated by my host (such as /ask, containing a message box which I cannot edit), I can't edit the code for the ask box so therefore it won't work. If anyone could provide a jQuery code that will

  1. Change the iFrame SRC with an ID of #askbox from "http://www.tumblr.com/ask_form/jamescharless.com" to "http://jamescharless.com/askbox"
  2. Remove the ID from the iFrame so it simply doesn't have an id

If anyone could help me it would be EXTREMELY helpful.

2 Answers 2

3

This should change your IFrame src

$("#askbox").attr("src", "http://jamescharless.com/askbox");

You could try:

$("#askbox").removeAttr("id");

Combine the two:

$("#askbox").attr("src", "http://jamescharless.com/askbox").removeAttr("id");

Trying to solve your scripting problem...

Opening the page in a debugger you can run:

document.getElementById('wrapper');

but not

document.getElementById('ask_form') - it throws an error

Plan B

How about injecting a fresh IFrame?

$('#ask_form').parent().html('<iframe width="100%" height="149" 
    src="http://jamescharless.com/askbox" frameBorder="0" 
    scrolling="no" style="overflow: hidden; background-color: transparent;">
    </iframe>');
Sign up to request clarification or add additional context in comments.

3 Comments

It's a permissions issue (see above);
So you're suggesting using jQuery to remove the iFrame and add a new one, the same one I have on my /FAQ page?
latest update finds the IFrame's mom and gets rid of it - works through the browser :) - yours is a slightly darker colour than the original.
1
   $(document).ready(function(){
       $('#askbox').attr("src", "http://jamescharless.com/askbox");
       $('#askbox').removeAttr("id");
   });

1 Comment

I could understand why this should work, but it's not working. jamescharless.com/ask Take a look, you'd be able to tell if it was working because the bar that says "Ask anonymously or login" should be darker than the ask button.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.